<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>API: calendar   Calendar.js  (YUI Library)</title>
	<link rel="stylesheet" type="text/css" href="assets/api.css">
</head>

<body id="yahoo-com">
<div id="doc3" class="yui-t2">

	<div id="hd">
        <h1>Yahoo! UI Library</h1>
        <h3>Calendar&nbsp; <span class="subtitle">2.2.2</span></h3>
        <p>
        <a href="./index.html">Yahoo! UI Library</a> 
            &gt; <a href="./module_calendar.html">calendar</a>
                
                 &gt; Calendar.js (source view) 
            </p>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">

                    <div id="srcout">
<div class="highlight" ><pre><span class="c">/**</span>
<span class="c">* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month (&quot;one-up&quot;) or two-month (&quot;two-up&quot;) interface. Calendars are generated entirely via script and can be navigated without any page refreshes.</span>
<span class="c">* @module    calendar</span>
<span class="c">* @title     Calendar</span>
<span class="c">* @namespace YAHOO.widget</span>
<span class="c">* @requires  yahoo,dom,event</span>
<span class="c">*/</span>

<span class="c">/**</span>
<span class="c">* Calendar is the base class for the Calendar widget. In its most basic</span>
<span class="c">* implementation, it has the ability to render a calendar widget on the page</span>
<span class="c">* that can be manipulated to select a single date, move back and forth between</span>
<span class="c">* months and years.</span>
<span class="c">* &lt;p&gt;To construct the placeholder for the calendar widget, the code is as</span>
<span class="c">* follows:</span>
<span class="c">*	&lt;xmp&gt;</span>
<span class="c">*		&lt;div id=&quot;cal1Container&quot;&gt;&lt;/div&gt;</span>
<span class="c">*	&lt;/xmp&gt;</span>
<span class="c">* Note that the table can be replaced with any kind of element.</span>
<span class="c">* &lt;/p&gt;</span>
<span class="c">* @namespace YAHOO.widget</span>
<span class="c">* @class Calendar</span>
<span class="c">* @constructor</span>
<span class="c">* @param {String}	id			The id of the table element that will represent the calendar widget</span>
<span class="c">* @param {String}	containerId	The id of the container div element that will wrap the calendar table</span>
<span class="c">* @param {Object}	config		The configuration object containing the Calendar&#39;s arguments</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">,</span> <span class="nx">containerId</span><span class="o">,</span> <span class="nx">config</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">init</span><span class="o">(</span><span class="nx">id</span><span class="o">,</span> <span class="nx">containerId</span><span class="o">,</span> <span class="nx">config</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The path to be used for images loaded for the Calendar</span>
<span class="c">* @property YAHOO.widget.Calendar.IMG_ROOT</span>
<span class="c">* @static</span>
<span class="c">* @deprecated	You can now customize images by overriding the calclose, calnavleft and calnavright default CSS classes for the close icon, left arrow and right arrow respectively</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">IMG_ROOT</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* Type constant used for renderers to represent an individual date (M/D/Y)</span>
<span class="c">* @property YAHOO.widget.Calendar.DATE</span>
<span class="c">* @static</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">DATE</span> <span class="o">=</span> <span class="s2">&quot;D&quot;</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* Type constant used for renderers to represent an individual date across any year (M/D)</span>
<span class="c">* @property YAHOO.widget.Calendar.MONTH_DAY</span>
<span class="c">* @static</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">MONTH_DAY</span> <span class="o">=</span> <span class="s2">&quot;MD&quot;</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* Type constant used for renderers to represent a weekday</span>
<span class="c">* @property YAHOO.widget.Calendar.WEEKDAY</span>
<span class="c">* @static</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">WEEKDAY</span> <span class="o">=</span> <span class="s2">&quot;WD&quot;</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* Type constant used for renderers to represent a range of individual dates (M/D/Y-M/D/Y)</span>
<span class="c">* @property YAHOO.widget.Calendar.RANGE</span>
<span class="c">* @static</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">RANGE</span> <span class="o">=</span> <span class="s2">&quot;R&quot;</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* Type constant used for renderers to represent a month across any year</span>
<span class="c">* @property YAHOO.widget.Calendar.MONTH</span>
<span class="c">* @static</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">MONTH</span> <span class="o">=</span> <span class="s2">&quot;M&quot;</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* Constant that represents the total number of date cells that are displayed in a given month</span>
<span class="c">* @property YAHOO.widget.Calendar.DISPLAY_DAYS</span>
<span class="c">* @static</span>
<span class="c">* @final</span>
<span class="c">* @type Number</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">DISPLAY_DAYS</span> <span class="o">=</span> <span class="m">42</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* Constant used for halting the execution of the remainder of the render stack</span>
<span class="c">* @property YAHOO.widget.Calendar.STOP_RENDER</span>
<span class="c">* @static</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">STOP_RENDER</span> <span class="o">=</span> <span class="s2">&quot;S&quot;</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* Constant used to represent short date field string formats (e.g. Tu or Feb)</span>
<span class="c">* @property YAHOO.widget.Calendar.SHORT</span>
<span class="c">* @static</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">SHORT</span> <span class="o">=</span> <span class="s2">&quot;short&quot;</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* Constant used to represent long date field string formats (e.g. Monday or February)</span>
<span class="c">* @property YAHOO.widget.Calendar.LONG</span>
<span class="c">* @static</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">LONG</span> <span class="o">=</span> <span class="s2">&quot;long&quot;</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* Constant used to represent medium date field string formats (e.g. Mon)</span>
<span class="c">* @property YAHOO.widget.Calendar.MEDIUM</span>
<span class="c">* @static</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">MEDIUM</span> <span class="o">=</span> <span class="s2">&quot;medium&quot;</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* Constant used to represent single character date field string formats (e.g. M, T, W)</span>
<span class="c">* @property YAHOO.widget.Calendar.ONE_CHAR</span>
<span class="c">* @static</span>
<span class="c">* @final</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">ONE_CHAR</span> <span class="o">=</span> <span class="s2">&quot;1char&quot;</span><span class="o">;</span>

<span class="c">/**</span>
<span class="c">* The set of default Config property keys and values for the Calendar</span>
<span class="c">* @property YAHOO.widget.Calendar._DEFAULT_CONFIG</span>
<span class="c">* @final</span>
<span class="c">* @static</span>
<span class="c">* @private</span>
<span class="c">* @type Object</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span> <span class="o">=</span> <span class="o">{</span>
	<span class="c">// Default values for pagedate and selected are not class level constants - they are set during instance creation </span>
<span class="c"></span>	<span class="nx">PAGEDATE</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;pagedate&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">null</span><span class="o">},</span>
	<span class="nx">SELECTED</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;selected&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">null</span><span class="o">},</span>
	<span class="nx">TITLE</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;title&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="s2">&quot;&quot;</span><span class="o">},</span>
	<span class="nx">CLOSE</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;close&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">false</span><span class="o">},</span>
	<span class="nx">IFRAME</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;iframe&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">true</span><span class="o">},</span>
	<span class="nx">MINDATE</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;mindate&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">null</span><span class="o">},</span>
	<span class="nx">MAXDATE</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;maxdate&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">null</span><span class="o">},</span>
	<span class="nx">MULTI_SELECT</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;multi_select&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">false</span><span class="o">},</span>
	<span class="nx">START_WEEKDAY</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;start_weekday&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="m">0</span><span class="o">},</span>
	<span class="nx">SHOW_WEEKDAYS</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;show_weekdays&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">true</span><span class="o">},</span>
	<span class="nx">SHOW_WEEK_HEADER</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;show_week_header&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">false</span><span class="o">},</span>
	<span class="nx">SHOW_WEEK_FOOTER</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;show_week_footer&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">false</span><span class="o">},</span>
	<span class="nx">HIDE_BLANK_WEEKS</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;hide_blank_weeks&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">false</span><span class="o">},</span>
	<span class="nx">NAV_ARROW_LEFT</span><span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;nav_arrow_left&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">null</span><span class="o">}</span> <span class="o">,</span>
	<span class="nx">NAV_ARROW_RIGHT</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;nav_arrow_right&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="kc">null</span><span class="o">}</span> <span class="o">,</span>
	<span class="nx">MONTHS_SHORT</span> <span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;months_short&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:[</span><span class="s2">&quot;Jan&quot;</span><span class="o">,</span> <span class="s2">&quot;Feb&quot;</span><span class="o">,</span> <span class="s2">&quot;Mar&quot;</span><span class="o">,</span> <span class="s2">&quot;Apr&quot;</span><span class="o">,</span> <span class="s2">&quot;May&quot;</span><span class="o">,</span> <span class="s2">&quot;Jun&quot;</span><span class="o">,</span> <span class="s2">&quot;Jul&quot;</span><span class="o">,</span> <span class="s2">&quot;Aug&quot;</span><span class="o">,</span> <span class="s2">&quot;Sep&quot;</span><span class="o">,</span> <span class="s2">&quot;Oct&quot;</span><span class="o">,</span> <span class="s2">&quot;Nov&quot;</span><span class="o">,</span> <span class="s2">&quot;Dec&quot;</span><span class="o">]},</span>
	<span class="nx">MONTHS_LONG</span><span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;months_long&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:[</span><span class="s2">&quot;January&quot;</span><span class="o">,</span> <span class="s2">&quot;February&quot;</span><span class="o">,</span> <span class="s2">&quot;March&quot;</span><span class="o">,</span> <span class="s2">&quot;April&quot;</span><span class="o">,</span> <span class="s2">&quot;May&quot;</span><span class="o">,</span> <span class="s2">&quot;June&quot;</span><span class="o">,</span> <span class="s2">&quot;July&quot;</span><span class="o">,</span> <span class="s2">&quot;August&quot;</span><span class="o">,</span> <span class="s2">&quot;September&quot;</span><span class="o">,</span> <span class="s2">&quot;October&quot;</span><span class="o">,</span> <span class="s2">&quot;November&quot;</span><span class="o">,</span> <span class="s2">&quot;December&quot;</span><span class="o">]},</span>
	<span class="nx">WEEKDAYS_1CHAR</span><span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;weekdays_1char&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:[</span><span class="s2">&quot;S&quot;</span><span class="o">,</span> <span class="s2">&quot;M&quot;</span><span class="o">,</span> <span class="s2">&quot;T&quot;</span><span class="o">,</span> <span class="s2">&quot;W&quot;</span><span class="o">,</span> <span class="s2">&quot;T&quot;</span><span class="o">,</span> <span class="s2">&quot;F&quot;</span><span class="o">,</span> <span class="s2">&quot;S&quot;</span><span class="o">]},</span>
	<span class="nx">WEEKDAYS_SHORT</span><span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;weekdays_short&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:[</span><span class="s2">&quot;Su&quot;</span><span class="o">,</span> <span class="s2">&quot;Mo&quot;</span><span class="o">,</span> <span class="s2">&quot;Tu&quot;</span><span class="o">,</span> <span class="s2">&quot;We&quot;</span><span class="o">,</span> <span class="s2">&quot;Th&quot;</span><span class="o">,</span> <span class="s2">&quot;Fr&quot;</span><span class="o">,</span> <span class="s2">&quot;Sa&quot;</span><span class="o">]},</span>
	<span class="nx">WEEKDAYS_MEDIUM</span><span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;weekdays_medium&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:[</span><span class="s2">&quot;Sun&quot;</span><span class="o">,</span> <span class="s2">&quot;Mon&quot;</span><span class="o">,</span> <span class="s2">&quot;Tue&quot;</span><span class="o">,</span> <span class="s2">&quot;Wed&quot;</span><span class="o">,</span> <span class="s2">&quot;Thu&quot;</span><span class="o">,</span> <span class="s2">&quot;Fri&quot;</span><span class="o">,</span> <span class="s2">&quot;Sat&quot;</span><span class="o">]},</span>
	<span class="nx">WEEKDAYS_LONG</span><span class="o">:</span> <span class="o">{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;weekdays_long&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:[</span><span class="s2">&quot;Sunday&quot;</span><span class="o">,</span> <span class="s2">&quot;Monday&quot;</span><span class="o">,</span> <span class="s2">&quot;Tuesday&quot;</span><span class="o">,</span> <span class="s2">&quot;Wednesday&quot;</span><span class="o">,</span> <span class="s2">&quot;Thursday&quot;</span><span class="o">,</span> <span class="s2">&quot;Friday&quot;</span><span class="o">,</span> <span class="s2">&quot;Saturday&quot;</span><span class="o">]},</span>
	<span class="nx">LOCALE_MONTHS</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;locale_months&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="s2">&quot;long&quot;</span><span class="o">},</span>
	<span class="nx">LOCALE_WEEKDAYS</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;locale_weekdays&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="s2">&quot;short&quot;</span><span class="o">},</span>
	<span class="nx">DATE_DELIMITER</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;date_delimiter&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="s2">&quot;,&quot;</span><span class="o">},</span>
	<span class="nx">DATE_FIELD_DELIMITER</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;date_field_delimiter&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="s2">&quot;/&quot;</span><span class="o">},</span>
	<span class="nx">DATE_RANGE_DELIMITER</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;date_range_delimiter&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="s2">&quot;-&quot;</span><span class="o">},</span>
	<span class="nx">MY_MONTH_POSITION</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;my_month_position&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="m">1</span><span class="o">},</span>
	<span class="nx">MY_YEAR_POSITION</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;my_year_position&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="m">2</span><span class="o">},</span>
	<span class="nx">MD_MONTH_POSITION</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;md_month_position&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="m">1</span><span class="o">},</span>
	<span class="nx">MD_DAY_POSITION</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;md_day_position&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="m">2</span><span class="o">},</span>
	<span class="nx">MDY_MONTH_POSITION</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;mdy_month_position&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="m">1</span><span class="o">},</span>
	<span class="nx">MDY_DAY_POSITION</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;mdy_day_position&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="m">2</span><span class="o">},</span>
	<span class="nx">MDY_YEAR_POSITION</span><span class="o">:{</span><span class="nx">key</span><span class="o">:</span><span class="s2">&quot;mdy_year_position&quot;</span><span class="o">,</span> <span class="nx">value</span><span class="o">:</span><span class="m">3</span><span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The set of Custom Event types supported by the Calendar</span>
<span class="c">* @property YAHOO.widget.Calendar._EVENT_TYPES</span>
<span class="c">* @final</span>
<span class="c">* @static</span>
<span class="c">* @private</span>
<span class="c">* @type Object</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_EVENT_TYPES</span> <span class="o">=</span> <span class="o">{</span>
	<span class="nx">BEFORE_SELECT</span> <span class="o">:</span> <span class="s2">&quot;beforeSelect&quot;</span><span class="o">,</span> 
	<span class="nx">SELECT</span> <span class="o">:</span> <span class="s2">&quot;select&quot;</span><span class="o">,</span>
	<span class="nx">BEFORE_DESELECT</span> <span class="o">:</span> <span class="s2">&quot;beforeDeselect&quot;</span><span class="o">,</span>
	<span class="nx">DESELECT</span> <span class="o">:</span> <span class="s2">&quot;deselect&quot;</span><span class="o">,</span>
	<span class="nx">CHANGE_PAGE</span> <span class="o">:</span> <span class="s2">&quot;changePage&quot;</span><span class="o">,</span>
	<span class="nx">BEFORE_RENDER</span> <span class="o">:</span> <span class="s2">&quot;beforeRender&quot;</span><span class="o">,</span>
	<span class="nx">RENDER</span> <span class="o">:</span> <span class="s2">&quot;render&quot;</span><span class="o">,</span>
	<span class="nx">RESET</span> <span class="o">:</span> <span class="s2">&quot;reset&quot;</span><span class="o">,</span>
	<span class="nx">CLEAR</span> <span class="o">:</span> <span class="s2">&quot;clear&quot;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The set of default style constants for the Calendar</span>
<span class="c">* @property YAHOO.widget.Calendar._STYLES</span>
<span class="c">* @final</span>
<span class="c">* @static</span>
<span class="c">* @private</span>
<span class="c">* @type Object</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_STYLES</span> <span class="o">=</span> <span class="o">{</span>
	<span class="nx">CSS_ROW_HEADER</span><span class="o">:</span> <span class="s2">&quot;calrowhead&quot;</span><span class="o">,</span>
	<span class="nx">CSS_ROW_FOOTER</span><span class="o">:</span> <span class="s2">&quot;calrowfoot&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL</span> <span class="o">:</span> <span class="s2">&quot;calcell&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_SELECTOR</span> <span class="o">:</span> <span class="s2">&quot;selector&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_SELECTED</span> <span class="o">:</span> <span class="s2">&quot;selected&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_SELECTABLE</span> <span class="o">:</span> <span class="s2">&quot;selectable&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_RESTRICTED</span> <span class="o">:</span> <span class="s2">&quot;restricted&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_TODAY</span> <span class="o">:</span> <span class="s2">&quot;today&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_OOM</span> <span class="o">:</span> <span class="s2">&quot;oom&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_OOB</span> <span class="o">:</span> <span class="s2">&quot;previous&quot;</span><span class="o">,</span>
	<span class="nx">CSS_HEADER</span> <span class="o">:</span> <span class="s2">&quot;calheader&quot;</span><span class="o">,</span>
	<span class="nx">CSS_HEADER_TEXT</span> <span class="o">:</span> <span class="s2">&quot;calhead&quot;</span><span class="o">,</span>
	<span class="nx">CSS_BODY</span> <span class="o">:</span> <span class="s2">&quot;calbody&quot;</span><span class="o">,</span>
	<span class="nx">CSS_WEEKDAY_CELL</span> <span class="o">:</span> <span class="s2">&quot;calweekdaycell&quot;</span><span class="o">,</span>
	<span class="nx">CSS_WEEKDAY_ROW</span> <span class="o">:</span> <span class="s2">&quot;calweekdayrow&quot;</span><span class="o">,</span>
	<span class="nx">CSS_FOOTER</span> <span class="o">:</span> <span class="s2">&quot;calfoot&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CALENDAR</span> <span class="o">:</span> <span class="s2">&quot;yui-calendar&quot;</span><span class="o">,</span>
	<span class="nx">CSS_SINGLE</span> <span class="o">:</span> <span class="s2">&quot;single&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CONTAINER</span> <span class="o">:</span> <span class="s2">&quot;yui-calcontainer&quot;</span><span class="o">,</span>
	<span class="nx">CSS_NAV_LEFT</span> <span class="o">:</span> <span class="s2">&quot;calnavleft&quot;</span><span class="o">,</span>
	<span class="nx">CSS_NAV_RIGHT</span> <span class="o">:</span> <span class="s2">&quot;calnavright&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CLOSE</span> <span class="o">:</span> <span class="s2">&quot;calclose&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_TOP</span> <span class="o">:</span> <span class="s2">&quot;calcelltop&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_LEFT</span> <span class="o">:</span> <span class="s2">&quot;calcellleft&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_RIGHT</span> <span class="o">:</span> <span class="s2">&quot;calcellright&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_BOTTOM</span> <span class="o">:</span> <span class="s2">&quot;calcellbottom&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_HOVER</span> <span class="o">:</span> <span class="s2">&quot;calcellhover&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_HIGHLIGHT1</span> <span class="o">:</span> <span class="s2">&quot;highlight1&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_HIGHLIGHT2</span> <span class="o">:</span> <span class="s2">&quot;highlight2&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_HIGHLIGHT3</span> <span class="o">:</span> <span class="s2">&quot;highlight3&quot;</span><span class="o">,</span>
	<span class="nx">CSS_CELL_HIGHLIGHT4</span> <span class="o">:</span> <span class="s2">&quot;highlight4&quot;</span>
<span class="o">};</span>

<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="o">{</span>

	<span class="c">/**</span>
<span class="c">	* The configuration object used to set up the calendars various locale and style options.</span>
<span class="c">	* @property Config</span>
<span class="c">	* @private</span>
<span class="c">	* @deprecated Configuration properties should be set by calling Calendar.cfg.setProperty.</span>
<span class="c">	* @type Object</span>
<span class="c">	*/</span>
	<span class="nx">Config</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

	<span class="c">/**</span>
<span class="c">	* The parent CalendarGroup, only to be set explicitly by the parent group</span>
<span class="c">	* @property parent</span>
<span class="c">	* @type CalendarGroup</span>
<span class="c">	*/</span>	
	<span class="nx">parent</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

	<span class="c">/**</span>
<span class="c">	* The index of this item in the parent group</span>
<span class="c">	* @property index</span>
<span class="c">	* @type Number</span>
<span class="c">	*/</span>
	<span class="nx">index</span> <span class="o">:</span> <span class="o">-</span><span class="m">1</span><span class="o">,</span>

	<span class="c">/**</span>
<span class="c">	* The collection of calendar table cells</span>
<span class="c">	* @property cells</span>
<span class="c">	* @type HTMLTableCellElement[]</span>
<span class="c">	*/</span>
	<span class="nx">cells</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
	
	<span class="c">/**</span>
<span class="c">	* The collection of calendar cell dates that is parallel to the cells collection. The array contains dates field arrays in the format of [YYYY, M, D].</span>
<span class="c">	* @property cellDates</span>
<span class="c">	* @type Array[](Number[])</span>
<span class="c">	*/</span>
	<span class="nx">cellDates</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

	<span class="c">/**</span>
<span class="c">	* The id that uniquely identifies this calendar. This id should match the id of the placeholder element on the page.</span>
<span class="c">	* @property id</span>
<span class="c">	* @type String</span>
<span class="c">	*/</span>
	<span class="nx">id</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

	<span class="c">/**</span>
<span class="c">	* The DOM element reference that points to this calendar&#39;s container element. The calendar will be inserted into this element when the shell is rendered.</span>
<span class="c">	* @property oDomContainer</span>
<span class="c">	* @type HTMLElement</span>
<span class="c">	*/</span>
	<span class="nx">oDomContainer</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

	<span class="c">/**</span>
<span class="c">	* A Date object representing today&#39;s date.</span>
<span class="c">	* @property today</span>
<span class="c">	* @type Date</span>
<span class="c">	*/</span>
	<span class="nx">today</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

	<span class="c">/**</span>
<span class="c">	* The list of render functions, along with required parameters, used to render cells. </span>
<span class="c">	* @property renderStack</span>
<span class="c">	* @type Array[]</span>
<span class="c">	*/</span>
	<span class="nx">renderStack</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

	<span class="c">/**</span>
<span class="c">	* A copy of the initial render functions created before rendering.</span>
<span class="c">	* @property _renderStack</span>
<span class="c">	* @private</span>
<span class="c">	* @type Array</span>
<span class="c">	*/</span>
	<span class="nx">_renderStack</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

	<span class="c">/**</span>
<span class="c">	* The private list of initially selected dates.</span>
<span class="c">	* @property _selectedDates</span>
<span class="c">	* @private</span>
<span class="c">	* @type Array</span>
<span class="c">	*/</span>
	<span class="nx">_selectedDates</span> <span class="o">:</span> <span class="kc">null</span><span class="o">,</span>

	<span class="c">/**</span>
<span class="c">	* A map of DOM event handlers to attach to cells associated with specific CSS class names</span>
<span class="c">	* @property domEventMap</span>
<span class="c">	* @type Object</span>
<span class="c">	*/</span>
	<span class="nx">domEventMap</span> <span class="o">:</span> <span class="kc">null</span>
<span class="o">};</span>



<span class="c">/**</span>
<span class="c">* Initializes the Calendar widget.</span>
<span class="c">* @method init</span>
<span class="c">* @param {String}	id			The id of the table element that will represent the calendar widget</span>
<span class="c">* @param {String}	containerId	The id of the container div element that will wrap the calendar table</span>
<span class="c">* @param {Object}	config		The configuration object containing the Calendar&#39;s arguments</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">init</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">,</span> <span class="nx">containerId</span><span class="o">,</span> <span class="nx">config</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">logger</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">LogWriter</span><span class="o">(</span><span class="s2">&quot;Calendar_Core &quot;</span> <span class="o">+</span> <span class="nx">id</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">initEvents</span><span class="o">();</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">today</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">();</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">clearTime</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">today</span><span class="o">);</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">id</span><span class="o">;</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">getElementById</span><span class="o">(</span><span class="nx">containerId</span><span class="o">);</span>
	<span class="k">if</span> <span class="o">(!</span> <span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">)</span> <span class="o">{</span> <span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;No valid container present.&quot;</span><span class="o">,</span> <span class="s2">&quot;error&quot;</span><span class="o">);</span> <span class="o">}</span>

	<span class="c">/**</span>
<span class="c">	* The Config object used to hold the configuration variables for the Calendar</span>
<span class="c">	* @property cfg</span>
<span class="c">	* @type YAHOO.util.Config</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Config</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
	
	<span class="c">/**</span>
<span class="c">	* The local object which contains the Calendar&#39;s options</span>
<span class="c">	* @property Options</span>
<span class="c">	* @type Object</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">Options</span> <span class="o">=</span> <span class="o">{};</span>

	<span class="c">/**</span>
<span class="c">	* The local object which contains the Calendar&#39;s locale settings</span>
<span class="c">	* @property Locale</span>
<span class="c">	* @type Object</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">Locale</span> <span class="o">=</span> <span class="o">{};</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">initStyles</span><span class="o">();</span>

	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CONTAINER</span><span class="o">);</span>	
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_SINGLE</span><span class="o">);</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">cellDates</span> <span class="o">=</span> <span class="o">[];</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cells</span> <span class="o">=</span> <span class="o">[];</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">renderStack</span> <span class="o">=</span> <span class="o">[];</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">_renderStack</span> <span class="o">=</span> <span class="o">[];</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">setupConfig</span><span class="o">();</span>
	
	<span class="k">if</span> <span class="o">(</span><span class="nx">config</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">applyConfig</span><span class="o">(</span><span class="nx">config</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="o">}</span>
	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">fireQueue</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders the built-in IFRAME shim for the IE6 and below</span>
<span class="c">* @method configIframe</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">configIframe</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">args</span><span class="o">,</span> <span class="nx">obj</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">useIframe</span> <span class="o">=</span> <span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>

	<span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">inDocument</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">))</span> <span class="o">{</span>
			<span class="k">if</span> <span class="o">(</span><span class="nx">useIframe</span><span class="o">)</span> <span class="o">{</span>
				<span class="k">var</span> <span class="nx">pos</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">,</span> <span class="s2">&quot;position&quot;</span><span class="o">);</span>

				<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span> <span class="o">==</span> <span class="s2">&quot;ie&quot;</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">pos</span> <span class="o">==</span> <span class="s2">&quot;absolute&quot;</span> <span class="o">||</span> <span class="nx">pos</span> <span class="o">==</span> <span class="s2">&quot;relative&quot;</span><span class="o">))</span> <span class="o">{</span>
					<span class="k">if</span> <span class="o">(!</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">inDocument</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">iframe</span><span class="o">))</span> <span class="o">{</span>
						<span class="k">this</span><span class="o">.</span><span class="nx">iframe</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;iframe&quot;</span><span class="o">);</span>
						<span class="k">this</span><span class="o">.</span><span class="nx">iframe</span><span class="o">.</span><span class="nx">src</span> <span class="o">=</span> <span class="s2">&quot;javascript:false;&quot;</span><span class="o">;</span>
						<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">setStyle</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">iframe</span><span class="o">,</span> <span class="s2">&quot;opacity&quot;</span><span class="o">,</span> <span class="s2">&quot;0&quot;</span><span class="o">);</span>
						<span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">iframe</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">);</span>
					<span class="o">}</span>
				<span class="o">}</span>
			<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
				<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">iframe</span><span class="o">)</span> <span class="o">{</span>
					<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">iframe</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">)</span> <span class="o">{</span>
						<span class="k">this</span><span class="o">.</span><span class="nx">iframe</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">iframe</span><span class="o">);</span>
					<span class="o">}</span>
					<span class="k">this</span><span class="o">.</span><span class="nx">iframe</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
				<span class="o">}</span>
			<span class="o">}</span>
		<span class="o">}</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Default handler for the &quot;title&quot; property</span>
<span class="c">* @method configTitle</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">configTitle</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">args</span><span class="o">,</span> <span class="nx">obj</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">title</span> <span class="o">=</span> <span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
	<span class="k">var</span> <span class="nx">close</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">CLOSE</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	
	<span class="k">var</span> <span class="nx">titleDiv</span><span class="o">;</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">title</span> <span class="o">&amp;&amp;</span> <span class="nx">title</span> <span class="o">!==</span> <span class="s2">&quot;&quot;</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">titleDiv</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getElementsByClassName</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">CalendarGroup</span><span class="o">.</span><span class="nx">CSS_2UPTITLE</span><span class="o">,</span> <span class="s2">&quot;div&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">)[</span><span class="m">0</span><span class="o">]</span> <span class="o">||</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;div&quot;</span><span class="o">);</span>
		<span class="nx">titleDiv</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">CalendarGroup</span><span class="o">.</span><span class="nx">CSS_2UPTITLE</span><span class="o">;</span>
		<span class="nx">titleDiv</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">title</span><span class="o">;</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="nx">titleDiv</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">);</span>
		<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">,</span> <span class="s2">&quot;withtitle&quot;</span><span class="o">);</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="nx">titleDiv</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getElementsByClassName</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">CalendarGroup</span><span class="o">.</span><span class="nx">CSS_2UPTITLE</span><span class="o">,</span> <span class="s2">&quot;div&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">)[</span><span class="m">0</span><span class="o">]</span> <span class="o">||</span> <span class="kc">null</span><span class="o">;</span>

		<span class="k">if</span> <span class="o">(</span><span class="nx">titleDiv</span><span class="o">)</span> <span class="o">{</span>
			<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">purgeElement</span><span class="o">(</span><span class="nx">titleDiv</span><span class="o">);</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">titleDiv</span><span class="o">);</span>
		<span class="o">}</span>
		<span class="k">if</span> <span class="o">(!</span> <span class="nx">close</span><span class="o">)</span> <span class="o">{</span>
			<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">,</span> <span class="s2">&quot;withtitle&quot;</span><span class="o">);</span>
		<span class="o">}</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Default handler for the &quot;close&quot; property</span>
<span class="c">* @method configClose</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">configClose</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">args</span><span class="o">,</span> <span class="nx">obj</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">close</span> <span class="o">=</span> <span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
	<span class="k">var</span> <span class="nx">title</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">TITLE</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	
	<span class="k">var</span> <span class="nx">DEPR_CLOSE_PATH</span> <span class="o">=</span> <span class="s2">&quot;us/my/bn/x_d.gif&quot;</span><span class="o">;</span>

	<span class="k">var</span> <span class="nx">linkClose</span><span class="o">;</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">close</span> <span class="o">===</span> <span class="kc">true</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">linkClose</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getElementsByClassName</span><span class="o">(</span><span class="s2">&quot;link-close&quot;</span><span class="o">,</span> <span class="s2">&quot;a&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">)[</span><span class="m">0</span><span class="o">]</span> <span class="o">||</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;a&quot;</span><span class="o">);</span>
		<span class="nx">linkClose</span><span class="o">.</span><span class="nx">href</span> <span class="o">=</span> <span class="s2">&quot;#&quot;</span><span class="o">;</span>
		<span class="nx">linkClose</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s2">&quot;link-close&quot;</span><span class="o">;</span>
		<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">addListener</span><span class="o">(</span><span class="nx">linkClose</span><span class="o">,</span> <span class="s2">&quot;click&quot;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">,</span> <span class="nx">cal</span><span class="o">)</span> <span class="o">{</span><span class="nx">cal</span><span class="o">.</span><span class="nx">hide</span><span class="o">();</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span> <span class="o">},</span> <span class="k">this</span><span class="o">);</span>
		
		<span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">IMG_ROOT</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
			<span class="k">var</span> <span class="nx">imgClose</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;img&quot;</span><span class="o">);</span>
			<span class="nx">imgClose</span><span class="o">.</span><span class="nx">src</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">IMG_ROOT</span> <span class="o">+</span> <span class="nx">DEPR_CLOSE_PATH</span><span class="o">;</span>
			<span class="nx">imgClose</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">CalendarGroup</span><span class="o">.</span><span class="nx">CSS_2UPCLOSE</span><span class="o">;</span>
			<span class="nx">linkClose</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">imgClose</span><span class="o">);</span>
		<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
			<span class="nx">linkClose</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&lt;span class=&quot;&#39;</span> <span class="o">+</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">CalendarGroup</span><span class="o">.</span><span class="nx">CSS_2UPCLOSE</span> <span class="o">+</span> <span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CLOSE</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&lt;/span&gt;&#39;</span><span class="o">;</span>
		<span class="o">}</span>
		
		<span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">linkClose</span><span class="o">);</span>
		<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">,</span> <span class="s2">&quot;withtitle&quot;</span><span class="o">);</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="nx">linkClose</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getElementsByClassName</span><span class="o">(</span><span class="s2">&quot;link-close&quot;</span><span class="o">,</span> <span class="s2">&quot;a&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">)[</span><span class="m">0</span><span class="o">]</span> <span class="o">||</span> <span class="kc">null</span><span class="o">;</span>
		<span class="k">if</span> <span class="o">(</span><span class="nx">linkClose</span><span class="o">)</span> <span class="o">{</span>
			<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">purgeElement</span><span class="o">(</span><span class="nx">linkClose</span><span class="o">);</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">linkClose</span><span class="o">);</span>
		<span class="o">}</span>
		<span class="k">if</span> <span class="o">(!</span> <span class="nx">title</span> <span class="o">||</span> <span class="nx">title</span> <span class="o">===</span> <span class="s2">&quot;&quot;</span><span class="o">)</span> <span class="o">{</span>
			<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">,</span> <span class="s2">&quot;withtitle&quot;</span><span class="o">);</span>
		<span class="o">}</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Initializes Calendar&#39;s built-in CustomEvents</span>
<span class="c">* @method initEvents</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">initEvents</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">defEvents</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_EVENT_TYPES</span><span class="o">;</span>

	<span class="c">/**</span>
<span class="c">	* Fired before a selection is made</span>
<span class="c">	* @event beforeSelectEvent</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">beforeSelectEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">CustomEvent</span><span class="o">(</span><span class="nx">defEvents</span><span class="o">.</span><span class="nx">BEFORE_SELECT</span><span class="o">);</span> 

	<span class="c">/**</span>
<span class="c">	* Fired when a selection is made</span>
<span class="c">	* @event selectEvent</span>
<span class="c">	* @param {Array}	Array of Date field arrays in the format [YYYY, MM, DD].</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">selectEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">CustomEvent</span><span class="o">(</span><span class="nx">defEvents</span><span class="o">.</span><span class="nx">SELECT</span><span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* Fired before a selection is made</span>
<span class="c">	* @event beforeDeselectEvent</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">beforeDeselectEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">CustomEvent</span><span class="o">(</span><span class="nx">defEvents</span><span class="o">.</span><span class="nx">BEFORE_DESELECT</span><span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* Fired when a selection is made</span>
<span class="c">	* @event deselectEvent</span>
<span class="c">	* @param {Array}	Array of Date field arrays in the format [YYYY, MM, DD].</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">deselectEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">CustomEvent</span><span class="o">(</span><span class="nx">defEvents</span><span class="o">.</span><span class="nx">DESELECT</span><span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* Fired when the Calendar page is changed</span>
<span class="c">	* @event changePageEvent</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">changePageEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">CustomEvent</span><span class="o">(</span><span class="nx">defEvents</span><span class="o">.</span><span class="nx">CHANGE_PAGE</span><span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* Fired before the Calendar is rendered</span>
<span class="c">	* @event beforeRenderEvent</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">beforeRenderEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">CustomEvent</span><span class="o">(</span><span class="nx">defEvents</span><span class="o">.</span><span class="nx">BEFORE_RENDER</span><span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* Fired when the Calendar is rendered</span>
<span class="c">	* @event renderEvent</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">renderEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">CustomEvent</span><span class="o">(</span><span class="nx">defEvents</span><span class="o">.</span><span class="nx">RENDER</span><span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* Fired when the Calendar is reset</span>
<span class="c">	* @event resetEvent</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">resetEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">CustomEvent</span><span class="o">(</span><span class="nx">defEvents</span><span class="o">.</span><span class="nx">RESET</span><span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* Fired when the Calendar is cleared</span>
<span class="c">	* @event clearEvent</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">clearEvent</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">CustomEvent</span><span class="o">(</span><span class="nx">defEvents</span><span class="o">.</span><span class="nx">CLEAR</span><span class="o">);</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">beforeSelectEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">onBeforeSelect</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">selectEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">onSelect</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">beforeDeselectEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">onBeforeDeselect</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">deselectEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">onDeselect</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">changePageEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">onChangePage</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">renderEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">onRender</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">resetEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">onReset</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">clearEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">onClear</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The default event function that is attached to a date link within a calendar cell</span>
<span class="c">* when the calendar is rendered.</span>
<span class="c">* @method doSelectCell</span>
<span class="c">* @param {DOMEvent} e	The event</span>
<span class="c">* @param {Calendar} cal	A reference to the calendar passed by the Event utility</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">doSelectCell</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">,</span> <span class="nx">cal</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">cell</span><span class="o">,</span><span class="nx">index</span><span class="o">,</span><span class="nx">d</span><span class="o">,</span><span class="nx">date</span><span class="o">;</span>

	<span class="k">var</span> <span class="nx">target</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">tagName</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">();</span>
	<span class="k">var</span> <span class="nx">defSelector</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

	<span class="k">while</span> <span class="o">(</span><span class="nx">tagName</span> <span class="o">!=</span> <span class="s2">&quot;td&quot;</span> <span class="o">&amp;&amp;</span> <span class="o">!</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">target</span><span class="o">,</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTABLE</span><span class="o">))</span> <span class="o">{</span>

		<span class="k">if</span> <span class="o">(!</span><span class="nx">defSelector</span> <span class="o">&amp;&amp;</span> <span class="nx">tagName</span> <span class="o">==</span> <span class="s2">&quot;a&quot;</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">target</span><span class="o">,</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTOR</span><span class="o">))</span> <span class="o">{</span>
			<span class="nx">defSelector</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>	
		<span class="o">}</span>

		<span class="nx">target</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">;</span>
		<span class="nx">tagName</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">();</span> 
		<span class="k">if</span> <span class="o">(</span><span class="nx">tagName</span> <span class="o">==</span> <span class="s2">&quot;html&quot;</span><span class="o">)</span> <span class="o">{</span>
			<span class="k">return</span><span class="o">;</span>
		<span class="o">}</span>
	<span class="o">}</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">defSelector</span><span class="o">)</span> <span class="o">{</span>
		<span class="c">// Stop link href navigation for default renderer</span>
<span class="c"></span>		<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">preventDefault</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span>
	<span class="o">}</span>

	<span class="nx">cell</span> <span class="o">=</span> <span class="nx">target</span><span class="o">;</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTABLE</span><span class="o">))</span> <span class="o">{</span>
		<span class="nx">index</span> <span class="o">=</span> <span class="nx">cell</span><span class="o">.</span><span class="nx">id</span><span class="o">.</span><span class="nx">split</span><span class="o">(</span><span class="s2">&quot;cell&quot;</span><span class="o">)[</span><span class="m">1</span><span class="o">];</span>
		<span class="nx">d</span> <span class="o">=</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">cellDates</span><span class="o">[</span><span class="nx">index</span><span class="o">];</span>
		<span class="nx">date</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">d</span><span class="o">[</span><span class="m">0</span><span class="o">],</span><span class="nx">d</span><span class="o">[</span><span class="m">1</span><span class="o">]-</span><span class="m">1</span><span class="o">,</span><span class="nx">d</span><span class="o">[</span><span class="m">2</span><span class="o">]);</span>
	
		<span class="k">var</span> <span class="nx">link</span><span class="o">;</span>

		<span class="nx">cal</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Selecting cell &quot;</span> <span class="o">+</span> <span class="nx">index</span> <span class="o">+</span> <span class="s2">&quot; via click&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">);</span>
		<span class="k">if</span> <span class="o">(</span><span class="nx">cal</span><span class="o">.</span><span class="nx">Options</span><span class="o">.</span><span class="nx">MULTI_SELECT</span><span class="o">)</span> <span class="o">{</span>
			<span class="nx">link</span> <span class="o">=</span> <span class="nx">cell</span><span class="o">.</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s2">&quot;a&quot;</span><span class="o">)[</span><span class="m">0</span><span class="o">];</span>
			<span class="k">if</span> <span class="o">(</span><span class="nx">link</span><span class="o">)</span> <span class="o">{</span>
				<span class="nx">link</span><span class="o">.</span><span class="nx">blur</span><span class="o">();</span>
			<span class="o">}</span>

			<span class="k">var</span> <span class="nx">cellDate</span> <span class="o">=</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">cellDates</span><span class="o">[</span><span class="nx">index</span><span class="o">];</span>
			<span class="k">var</span> <span class="nx">cellDateIndex</span> <span class="o">=</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">_indexOfSelectedFieldArray</span><span class="o">(</span><span class="nx">cellDate</span><span class="o">);</span>

			<span class="k">if</span> <span class="o">(</span><span class="nx">cellDateIndex</span> <span class="o">&gt;</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>	
				<span class="nx">cal</span><span class="o">.</span><span class="nx">deselectCell</span><span class="o">(</span><span class="nx">index</span><span class="o">);</span>
			<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
				<span class="nx">cal</span><span class="o">.</span><span class="nx">selectCell</span><span class="o">(</span><span class="nx">index</span><span class="o">);</span>
			<span class="o">}</span>	

		<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
			<span class="nx">link</span> <span class="o">=</span> <span class="nx">cell</span><span class="o">.</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s2">&quot;a&quot;</span><span class="o">)[</span><span class="m">0</span><span class="o">];</span>
			<span class="k">if</span> <span class="o">(</span><span class="nx">link</span><span class="o">)</span> <span class="o">{</span>
				<span class="nx">link</span><span class="o">.</span><span class="nx">blur</span><span class="o">();</span>
			<span class="o">}</span>
			<span class="nx">cal</span><span class="o">.</span><span class="nx">selectCell</span><span class="o">(</span><span class="nx">index</span><span class="o">);</span>
		<span class="o">}</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The event that is executed when the user hovers over a cell</span>
<span class="c">* @method doCellMouseOver</span>
<span class="c">* @param {DOMEvent} e	The event</span>
<span class="c">* @param {Calendar} cal	A reference to the calendar passed by the Event utility</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">doCellMouseOver</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">,</span> <span class="nx">cal</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">target</span><span class="o">;</span>
	<span class="k">if</span> <span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">target</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="nx">target</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
	<span class="o">}</span>

	<span class="k">while</span> <span class="o">(</span><span class="nx">target</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">!=</span> <span class="s2">&quot;td&quot;</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">target</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">;</span>
		<span class="k">if</span> <span class="o">(</span><span class="nx">target</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s2">&quot;html&quot;</span><span class="o">)</span> <span class="o">{</span>
			<span class="k">return</span><span class="o">;</span>
		<span class="o">}</span>
	<span class="o">}</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">target</span><span class="o">,</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTABLE</span><span class="o">))</span> <span class="o">{</span>
		<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">target</span><span class="o">,</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_HOVER</span><span class="o">);</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The event that is executed when the user moves the mouse out of a cell</span>
<span class="c">* @method doCellMouseOut</span>
<span class="c">* @param {DOMEvent} e	The event</span>
<span class="c">* @param {Calendar} cal	A reference to the calendar passed by the Event utility</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">doCellMouseOut</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">e</span><span class="o">,</span> <span class="nx">cal</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">target</span><span class="o">;</span>
	<span class="k">if</span> <span class="o">(</span><span class="nx">e</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">target</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">e</span><span class="o">);</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="nx">target</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
	<span class="o">}</span>

	<span class="k">while</span> <span class="o">(</span><span class="nx">target</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">!=</span> <span class="s2">&quot;td&quot;</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">target</span> <span class="o">=</span> <span class="nx">target</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">;</span>
		<span class="k">if</span> <span class="o">(</span><span class="nx">target</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s2">&quot;html&quot;</span><span class="o">)</span> <span class="o">{</span>
			<span class="k">return</span><span class="o">;</span>
		<span class="o">}</span>
	<span class="o">}</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">target</span><span class="o">,</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTABLE</span><span class="o">))</span> <span class="o">{</span>
		<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">target</span><span class="o">,</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_HOVER</span><span class="o">);</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">setupConfig</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">defCfg</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">;</span>

	<span class="c">/**</span>
<span class="c">	* The month/year representing the current visible Calendar date (mm/yyyy)</span>
<span class="c">	* @config pagedate</span>
<span class="c">	* @type String</span>
<span class="c">	* @default today&#39;s date</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="k">new</span> <span class="nb">Date</span><span class="o">(),</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configPageDate</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The date or range of dates representing the current Calendar selection</span>
<span class="c">	* @config selected</span>
<span class="c">	* @type String</span>
<span class="c">	* @default []</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:[],</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configSelected</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The title to display above the Calendar&#39;s month header</span>
<span class="c">	* @config title</span>
<span class="c">	* @type String</span>
<span class="c">	* @default &quot;&quot;</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">TITLE</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">TITLE</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configTitle</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* Whether or not a close button should be displayed for this Calendar</span>
<span class="c">	* @config close</span>
<span class="c">	* @type Boolean</span>
<span class="c">	* @default false</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">CLOSE</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">CLOSE</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configClose</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.</span>
<span class="c">	* @config iframe</span>
<span class="c">	* @type Boolean</span>
<span class="c">	* @default true</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">IFRAME</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">IFRAME</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configIframe</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkBoolean</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The minimum selectable date in the current Calendar (mm/dd/yyyy)</span>
<span class="c">	* @config mindate</span>
<span class="c">	* @type String</span>
<span class="c">	* @default null</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MINDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MINDATE</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configMinDate</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The maximum selectable date in the current Calendar (mm/dd/yyyy)</span>
<span class="c">	* @config maxdate</span>
<span class="c">	* @type String</span>
<span class="c">	* @default null</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MAXDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MAXDATE</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configMaxDate</span> <span class="o">}</span> <span class="o">);</span>


	<span class="c">// Options properties</span>
<span class="c"></span>
	<span class="c">/**</span>
<span class="c">	* True if the Calendar should allow multiple selections. False by default.</span>
<span class="c">	* @config MULTI_SELECT</span>
<span class="c">	* @type Boolean</span>
<span class="c">	* @default false</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MULTI_SELECT</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MULTI_SELECT</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configOptions</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkBoolean</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The weekday the week begins on. Default is 0 (Sunday).</span>
<span class="c">	* @config START_WEEKDAY</span>
<span class="c">	* @type number</span>
<span class="c">	* @default 0</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">START_WEEKDAY</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">START_WEEKDAY</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configOptions</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkNumber</span>  <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* True if the Calendar should show weekday labels. True by default.</span>
<span class="c">	* @config SHOW_WEEKDAYS</span>
<span class="c">	* @type Boolean</span>
<span class="c">	* @default true</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEKDAYS</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEKDAYS</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configOptions</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkBoolean</span>  <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* True if the Calendar should show week row headers. False by default.</span>
<span class="c">	* @config SHOW_WEEK_HEADER</span>
<span class="c">	* @type Boolean</span>
<span class="c">	* @default false</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEK_HEADER</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEK_HEADER</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configOptions</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkBoolean</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* True if the Calendar should show week row footers. False by default.</span>
<span class="c">	* @config SHOW_WEEK_FOOTER</span>
<span class="c">	* @type Boolean</span>
<span class="c">	* @default false</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEK_FOOTER</span><span class="o">.</span><span class="nx">key</span><span class="o">,{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEK_FOOTER</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configOptions</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkBoolean</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* True if the Calendar should suppress weeks that are not a part of the current month. False by default.</span>
<span class="c">	* @config HIDE_BLANK_WEEKS</span>
<span class="c">	* @type Boolean</span>
<span class="c">	* @default false</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">HIDE_BLANK_WEEKS</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">HIDE_BLANK_WEEKS</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configOptions</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkBoolean</span> <span class="o">}</span> <span class="o">);</span>
	
	<span class="c">/**</span>
<span class="c">	* The image that should be used for the left navigation arrow.</span>
<span class="c">	* @config NAV_ARROW_LEFT</span>
<span class="c">	* @type String</span>
<span class="c">	* @deprecated	You can customize the image by overriding the default CSS class for the left arrow - &quot;calnavleft&quot;  </span>
<span class="c">	* @default null</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">NAV_ARROW_LEFT</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">NAV_ARROW_LEFT</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configOptions</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The image that should be used for the right navigation arrow.</span>
<span class="c">	* @config NAV_ARROW_RIGHT</span>
<span class="c">	* @type String</span>
<span class="c">	* @deprecated	You can customize the image by overriding the default CSS class for the right arrow - &quot;calnavright&quot;</span>
<span class="c">	* @default null</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">NAV_ARROW_RIGHT</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">NAV_ARROW_RIGHT</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configOptions</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">// Locale properties</span>
<span class="c"></span>
	<span class="c">/**</span>
<span class="c">	* The short month labels for the current locale.</span>
<span class="c">	* @config MONTHS_SHORT</span>
<span class="c">	* @type String[]</span>
<span class="c">	* @default [&quot;Jan&quot;, &quot;Feb&quot;, &quot;Mar&quot;, &quot;Apr&quot;, &quot;May&quot;, &quot;Jun&quot;, &quot;Jul&quot;, &quot;Aug&quot;, &quot;Sep&quot;, &quot;Oct&quot;, &quot;Nov&quot;, &quot;Dec&quot;]</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MONTHS_SHORT</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MONTHS_SHORT</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span> <span class="o">}</span> <span class="o">);</span>
	
	<span class="c">/**</span>
<span class="c">	* The long month labels for the current locale.</span>
<span class="c">	* @config MONTHS_LONG</span>
<span class="c">	* @type String[]</span>
<span class="c">	* @default [&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot;, &quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;August&quot;, &quot;September&quot;, &quot;October&quot;, &quot;November&quot;, &quot;December&quot;</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MONTHS_LONG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>		<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MONTHS_LONG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span> <span class="o">}</span> <span class="o">);</span>
	
	<span class="c">/**</span>
<span class="c">	* The 1-character weekday labels for the current locale.</span>
<span class="c">	* @config WEEKDAYS_1CHAR</span>
<span class="c">	* @type String[]</span>
<span class="c">	* @default [&quot;S&quot;, &quot;M&quot;, &quot;T&quot;, &quot;W&quot;, &quot;T&quot;, &quot;F&quot;, &quot;S&quot;]</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_1CHAR</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_1CHAR</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span> <span class="o">}</span> <span class="o">);</span>
	
	<span class="c">/**</span>
<span class="c">	* The short weekday labels for the current locale.</span>
<span class="c">	* @config WEEKDAYS_SHORT</span>
<span class="c">	* @type String[]</span>
<span class="c">	* @default [&quot;Su&quot;, &quot;Mo&quot;, &quot;Tu&quot;, &quot;We&quot;, &quot;Th&quot;, &quot;Fr&quot;, &quot;Sa&quot;]</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_SHORT</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_SHORT</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span> <span class="o">}</span> <span class="o">);</span>
	
	<span class="c">/**</span>
<span class="c">	* The medium weekday labels for the current locale.</span>
<span class="c">	* @config WEEKDAYS_MEDIUM</span>
<span class="c">	* @type String[]</span>
<span class="c">	* @default [&quot;Sun&quot;, &quot;Mon&quot;, &quot;Tue&quot;, &quot;Wed&quot;, &quot;Thu&quot;, &quot;Fri&quot;, &quot;Sat&quot;]</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_MEDIUM</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_MEDIUM</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span> <span class="o">}</span> <span class="o">);</span>
	
	<span class="c">/**</span>
<span class="c">	* The long weekday labels for the current locale.</span>
<span class="c">	* @config WEEKDAYS_LONG</span>
<span class="c">	* @type String[]</span>
<span class="c">	* @default [&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;]</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_LONG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_LONG</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* Refreshes the locale values used to build the Calendar.</span>
<span class="c">	* @method refreshLocale</span>
<span class="c">	* @private</span>
<span class="c">	*/</span>
	<span class="k">var</span> <span class="nx">refreshLocale</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">LOCALE_MONTHS</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="o">};</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">START_WEEKDAY</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="nx">refreshLocale</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MONTHS_SHORT</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="nx">refreshLocale</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MONTHS_LONG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="nx">refreshLocale</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_1CHAR</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="nx">refreshLocale</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_SHORT</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="nx">refreshLocale</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_MEDIUM</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="nx">refreshLocale</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">subscribeToConfigEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_LONG</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="nx">refreshLocale</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	
	<span class="c">/**</span>
<span class="c">	* The setting that determines which length of month labels should be used. Possible values are &quot;short&quot; and &quot;long&quot;.</span>
<span class="c">	* @config LOCALE_MONTHS</span>
<span class="c">	* @type String</span>
<span class="c">	* @default &quot;long&quot;</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">LOCALE_MONTHS</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">LOCALE_MONTHS</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocaleValues</span> <span class="o">}</span> <span class="o">);</span>
	
	<span class="c">/**</span>
<span class="c">	* The setting that determines which length of weekday labels should be used. Possible values are &quot;1char&quot;, &quot;short&quot;, &quot;medium&quot;, and &quot;long&quot;.</span>
<span class="c">	* @config LOCALE_WEEKDAYS</span>
<span class="c">	* @type String</span>
<span class="c">	* @default &quot;short&quot;</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocaleValues</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The value used to delimit individual dates in a date string passed to various Calendar functions.</span>
<span class="c">	* @config DATE_DELIMITER</span>
<span class="c">	* @type String</span>
<span class="c">	* @default &quot;,&quot;</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">DATE_DELIMITER</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>		<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">DATE_DELIMITER</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The value used to delimit date fields in a date string passed to various Calendar functions.</span>
<span class="c">	* @config DATE_FIELD_DELIMITER</span>
<span class="c">	* @type String</span>
<span class="c">	* @default &quot;/&quot;</span>
<span class="c">	*/</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">DATE_FIELD_DELIMITER</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">DATE_FIELD_DELIMITER</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The value used to delimit date ranges in a date string passed to various Calendar functions.</span>
<span class="c">	* @config DATE_RANGE_DELIMITER</span>
<span class="c">	* @type String</span>
<span class="c">	* @default &quot;-&quot;</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">DATE_RANGE_DELIMITER</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">DATE_RANGE_DELIMITER</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The position of the month in a month/year date string</span>
<span class="c">	* @config MY_MONTH_POSITION</span>
<span class="c">	* @type Number</span>
<span class="c">	* @default 1</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MY_MONTH_POSITION</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MY_MONTH_POSITION</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkNumber</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The position of the year in a month/year date string</span>
<span class="c">	* @config MY_YEAR_POSITION</span>
<span class="c">	* @type Number</span>
<span class="c">	* @default 2</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MY_YEAR_POSITION</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MY_YEAR_POSITION</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkNumber</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The position of the month in a month/day date string</span>
<span class="c">	* @config MD_MONTH_POSITION</span>
<span class="c">	* @type Number</span>
<span class="c">	* @default 1</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MD_MONTH_POSITION</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MD_MONTH_POSITION</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkNumber</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The position of the day in a month/year date string</span>
<span class="c">	* @config MD_DAY_POSITION</span>
<span class="c">	* @type Number</span>
<span class="c">	* @default 2</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MD_DAY_POSITION</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>		<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MD_DAY_POSITION</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkNumber</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The position of the month in a month/day/year date string</span>
<span class="c">	* @config MDY_MONTH_POSITION</span>
<span class="c">	* @type Number</span>
<span class="c">	* @default 1</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MDY_MONTH_POSITION</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MDY_MONTH_POSITION</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkNumber</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The position of the day in a month/day/year date string</span>
<span class="c">	* @config MDY_DAY_POSITION</span>
<span class="c">	* @type Number</span>
<span class="c">	* @default 2</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MDY_DAY_POSITION</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MDY_DAY_POSITION</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkNumber</span> <span class="o">}</span> <span class="o">);</span>

	<span class="c">/**</span>
<span class="c">	* The position of the year in a month/day/year date string</span>
<span class="c">	* @config MDY_YEAR_POSITION</span>
<span class="c">	* @type Number</span>
<span class="c">	* @default 3</span>
<span class="c">	*/</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">addProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MDY_YEAR_POSITION</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span>	<span class="o">{</span> <span class="nx">value</span><span class="o">:</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MDY_YEAR_POSITION</span><span class="o">.</span><span class="nx">value</span><span class="o">,</span> <span class="nx">handler</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">configLocale</span><span class="o">,</span> <span class="nx">validator</span><span class="o">:</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">checkNumber</span> <span class="o">}</span> <span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The default handler for the &quot;pagedate&quot; property</span>
<span class="c">* @method configPageDate</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">configPageDate</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">args</span><span class="o">,</span> <span class="nx">obj</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_parsePageDate</span><span class="o">(</span><span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">]),</span> <span class="kc">true</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The default handler for the &quot;mindate&quot; property</span>
<span class="c">* @method configMinDate</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">configMinDate</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">args</span><span class="o">,</span> <span class="nx">obj</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">val</span> <span class="o">=</span> <span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
	<span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">val</span><span class="o">))</span> <span class="o">{</span>
		<span class="nx">val</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_parseDate</span><span class="o">(</span><span class="nx">val</span><span class="o">);</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">MINDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">val</span><span class="o">[</span><span class="m">0</span><span class="o">],(</span><span class="nx">val</span><span class="o">[</span><span class="m">1</span><span class="o">]-</span><span class="m">1</span><span class="o">),</span><span class="nx">val</span><span class="o">[</span><span class="m">2</span><span class="o">]));</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The default handler for the &quot;maxdate&quot; property</span>
<span class="c">* @method configMaxDate</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">configMaxDate</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">args</span><span class="o">,</span> <span class="nx">obj</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">val</span> <span class="o">=</span> <span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
	<span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">val</span><span class="o">))</span> <span class="o">{</span>
		<span class="nx">val</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_parseDate</span><span class="o">(</span><span class="nx">val</span><span class="o">);</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">MAXDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">val</span><span class="o">[</span><span class="m">0</span><span class="o">],(</span><span class="nx">val</span><span class="o">[</span><span class="m">1</span><span class="o">]-</span><span class="m">1</span><span class="o">),</span><span class="nx">val</span><span class="o">[</span><span class="m">2</span><span class="o">]));</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The default handler for the &quot;selected&quot; property</span>
<span class="c">* @method configSelected</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">configSelected</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">args</span><span class="o">,</span> <span class="nx">obj</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">selected</span> <span class="o">=</span> <span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
	<span class="k">var</span> <span class="nx">cfgSelected</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>
	
	<span class="k">if</span> <span class="o">(</span><span class="nx">selected</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">selected</span><span class="o">))</span> <span class="o">{</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_parseDates</span><span class="o">(</span><span class="nx">selected</span><span class="o">),</span> <span class="kc">true</span><span class="o">);</span>
		<span class="o">}</span> 
	<span class="o">}</span>
	<span class="k">if</span> <span class="o">(!</span> <span class="k">this</span><span class="o">.</span><span class="nx">_selectedDates</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">_selectedDates</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">);</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The default handler for all configuration options properties</span>
<span class="c">* @method configOptions</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">configOptions</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">args</span><span class="o">,</span> <span class="nx">obj</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">Options</span><span class="o">[</span><span class="nx">type</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">()]</span> <span class="o">=</span> <span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The default handler for all configuration locale properties</span>
<span class="c">* @method configLocale</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">configLocale</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">args</span><span class="o">,</span> <span class="nx">obj</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">defCfg</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">;</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">[</span><span class="nx">type</span><span class="o">.</span><span class="nx">toUpperCase</span><span class="o">()]</span> <span class="o">=</span> <span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">LOCALE_MONTHS</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The default handler for all configuration locale field length properties</span>
<span class="c">* @method configLocaleValues</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">configLocaleValues</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">args</span><span class="o">,</span> <span class="nx">obj</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">defCfg</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">;</span> 

	<span class="nx">type</span> <span class="o">=</span> <span class="nx">type</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">();</span>
	<span class="k">var</span> <span class="nx">val</span> <span class="o">=</span> <span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>

	<span class="nx">switch</span> <span class="o">(</span><span class="nx">type</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">case</span> <span class="nx">defCfg</span><span class="o">.</span><span class="nx">LOCALE_MONTHS</span><span class="o">.</span><span class="nx">key</span><span class="o">:</span>
			<span class="nx">switch</span> <span class="o">(</span><span class="nx">val</span><span class="o">)</span> <span class="o">{</span>
				<span class="nx">case</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">SHORT</span><span class="o">:</span>
					<span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">LOCALE_MONTHS</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MONTHS_SHORT</span><span class="o">.</span><span class="nx">key</span><span class="o">).</span><span class="nx">concat</span><span class="o">();</span>
					<span class="k">break</span><span class="o">;</span>
				<span class="nx">case</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">LONG</span><span class="o">:</span>
					<span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">LOCALE_MONTHS</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MONTHS_LONG</span><span class="o">.</span><span class="nx">key</span><span class="o">).</span><span class="nx">concat</span><span class="o">();</span>
					<span class="k">break</span><span class="o">;</span>
			<span class="o">}</span>
			<span class="k">break</span><span class="o">;</span>
		<span class="nx">case</span> <span class="nx">defCfg</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span><span class="o">.</span><span class="nx">key</span><span class="o">:</span>
			<span class="nx">switch</span> <span class="o">(</span><span class="nx">val</span><span class="o">)</span> <span class="o">{</span>
				<span class="nx">case</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">ONE_CHAR</span><span class="o">:</span>
					<span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_1CHAR</span><span class="o">.</span><span class="nx">key</span><span class="o">).</span><span class="nx">concat</span><span class="o">();</span>
					<span class="k">break</span><span class="o">;</span>
				<span class="nx">case</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">SHORT</span><span class="o">:</span>
					<span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_SHORT</span><span class="o">.</span><span class="nx">key</span><span class="o">).</span><span class="nx">concat</span><span class="o">();</span>
					<span class="k">break</span><span class="o">;</span>
				<span class="nx">case</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">MEDIUM</span><span class="o">:</span>
					<span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_MEDIUM</span><span class="o">.</span><span class="nx">key</span><span class="o">).</span><span class="nx">concat</span><span class="o">();</span>
					<span class="k">break</span><span class="o">;</span>
				<span class="nx">case</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">LONG</span><span class="o">:</span>
					<span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">WEEKDAYS_LONG</span><span class="o">.</span><span class="nx">key</span><span class="o">).</span><span class="nx">concat</span><span class="o">();</span>
					<span class="k">break</span><span class="o">;</span>
			<span class="o">}</span>
			
			<span class="k">var</span> <span class="nx">START_WEEKDAY</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">START_WEEKDAY</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>

			<span class="k">if</span> <span class="o">(</span><span class="nx">START_WEEKDAY</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
				<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">w</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">w</span><span class="o">&lt;</span><span class="nx">START_WEEKDAY</span><span class="o">;++</span><span class="nx">w</span><span class="o">)</span> <span class="o">{</span>
					<span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span><span class="o">.</span><span class="nx">shift</span><span class="o">());</span>
				<span class="o">}</span>
			<span class="o">}</span>
			<span class="k">break</span><span class="o">;</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Defines the style constants for the Calendar</span>
<span class="c">* @method initStyles</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">initStyles</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">defStyle</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_STYLES</span><span class="o">;</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">Style</span> <span class="o">=</span> <span class="o">{</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_ROW_HEADER</span>
<span class="c">		*/</span>
		<span class="nx">CSS_ROW_HEADER</span><span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_ROW_HEADER</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_ROW_FOOTER</span>
<span class="c">		*/</span>
		<span class="nx">CSS_ROW_FOOTER</span><span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_ROW_FOOTER</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_SELECTOR</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_SELECTOR</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTOR</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_SELECTED</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_SELECTED</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTED</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_SELECTABLE</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_SELECTABLE</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTABLE</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_RESTRICTED</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_RESTRICTED</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_RESTRICTED</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_TODAY</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_TODAY</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_TODAY</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_OOM</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_OOM</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_OOM</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_OOB</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_OOB</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_OOB</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_HEADER</span>
<span class="c">		*/</span>
		<span class="nx">CSS_HEADER</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_HEADER</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_HEADER_TEXT</span>
<span class="c">		*/</span>
		<span class="nx">CSS_HEADER_TEXT</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_HEADER_TEXT</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_BODY</span>
<span class="c">		*/</span>
		<span class="nx">CSS_BODY</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_BODY</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_WEEKDAY_CELL</span>
<span class="c">		*/</span>
		<span class="nx">CSS_WEEKDAY_CELL</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_WEEKDAY_CELL</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_WEEKDAY_ROW</span>
<span class="c">		*/</span>
		<span class="nx">CSS_WEEKDAY_ROW</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_WEEKDAY_ROW</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_FOOTER</span>
<span class="c">		*/</span>
		<span class="nx">CSS_FOOTER</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_FOOTER</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CALENDAR</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CALENDAR</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CALENDAR</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_SINGLE</span>
<span class="c">		*/</span>
		<span class="nx">CSS_SINGLE</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_SINGLE</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CONTAINER</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CONTAINER</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CONTAINER</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_NAV_LEFT</span>
<span class="c">		*/</span>
		<span class="nx">CSS_NAV_LEFT</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_NAV_LEFT</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_NAV_RIGHT</span>
<span class="c">		*/</span>
		<span class="nx">CSS_NAV_RIGHT</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_NAV_RIGHT</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CLOSE</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CLOSE</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CLOSE</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_TOP</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_TOP</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_TOP</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_LEFT</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_LEFT</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_LEFT</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_RIGHT</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_RIGHT</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_RIGHT</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_BOTTOM</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_BOTTOM</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_BOTTOM</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_HOVER</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_HOVER</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_HOVER</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_HIGHLIGHT1</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_HIGHLIGHT1</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_HIGHLIGHT1</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_HIGHLIGHT2</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_HIGHLIGHT2</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_HIGHLIGHT2</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_HIGHLIGHT3</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_HIGHLIGHT3</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_HIGHLIGHT3</span><span class="o">,</span>
		<span class="c">/**</span>
<span class="c">		* @property Style.CSS_CELL_HIGHLIGHT4</span>
<span class="c">		*/</span>
		<span class="nx">CSS_CELL_HIGHLIGHT4</span> <span class="o">:</span> <span class="nx">defStyle</span><span class="o">.</span><span class="nx">CSS_CELL_HIGHLIGHT4</span>
	<span class="o">};</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Builds the date label that will be displayed in the calendar header or</span>
<span class="c">* footer, depending on configuration.</span>
<span class="c">* @method buildMonthLabel</span>
<span class="c">* @return	{String}	The formatted calendar month label</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">buildMonthLabel</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">pageDate</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">LOCALE_MONTHS</span><span class="o">[</span><span class="nx">pageDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()]</span> <span class="o">+</span> <span class="s2">&quot; &quot;</span> <span class="o">+</span> <span class="nx">pageDate</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Builds the date digit that will be displayed in calendar cells</span>
<span class="c">* @method buildDayLabel</span>
<span class="c">* @param {Date}	workingDate	The current working date</span>
<span class="c">* @return	{String}	The formatted day label</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">buildDayLabel</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">return</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDate</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders the calendar header.</span>
<span class="c">* @method renderHeader</span>
<span class="c">* @param {Array}	html	The current working HTML array</span>
<span class="c">* @return {Array} The current working HTML array</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderHeader</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">html</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Rendering header&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">colSpan</span> <span class="o">=</span> <span class="m">7</span><span class="o">;</span>
	
	<span class="k">var</span> <span class="nx">DEPR_NAV_LEFT</span> <span class="o">=</span> <span class="s2">&quot;us/tr/callt.gif&quot;</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">DEPR_NAV_RIGHT</span> <span class="o">=</span> <span class="s2">&quot;us/tr/calrt.gif&quot;</span><span class="o">;</span>	
	<span class="k">var</span> <span class="nx">defCfg</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">;</span>
	
	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEK_HEADER</span><span class="o">.</span><span class="nx">key</span><span class="o">))</span> <span class="o">{</span>
		<span class="nx">colSpan</span> <span class="o">+=</span> <span class="m">1</span><span class="o">;</span>
	<span class="o">}</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEK_FOOTER</span><span class="o">.</span><span class="nx">key</span><span class="o">))</span> <span class="o">{</span>
		<span class="nx">colSpan</span> <span class="o">+=</span> <span class="m">1</span><span class="o">;</span>
	<span class="o">}</span>

	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s2">&quot;&lt;thead&gt;&quot;</span><span class="o">;</span>
	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span>		<span class="s2">&quot;&lt;tr&gt;&quot;</span><span class="o">;</span>
	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span>			<span class="s1">&#39;&lt;th colspan=&quot;&#39;</span> <span class="o">+</span> <span class="nx">colSpan</span> <span class="o">+</span> <span class="s1">&#39;&quot; class=&quot;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_HEADER_TEXT</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span><span class="o">;</span>
	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span>				<span class="s1">&#39;&lt;div class=&quot;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_HEADER</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span><span class="o">;</span>

	<span class="k">var</span> <span class="nx">renderLeft</span><span class="o">,</span> <span class="nx">renderRight</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">index</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
			<span class="nx">renderLeft</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
		<span class="o">}</span>
		<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">index</span> <span class="o">==</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="s2">&quot;pages&quot;</span><span class="o">)</span> <span class="o">-</span><span class="m">1</span><span class="o">))</span> <span class="o">{</span>
			<span class="nx">renderRight</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
		<span class="o">}</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="nx">renderLeft</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
		<span class="nx">renderRight</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
	<span class="o">}</span>

	<span class="k">var</span> <span class="nx">cal</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span> <span class="o">||</span> <span class="k">this</span><span class="o">;</span>
	
	<span class="k">if</span> <span class="o">(</span><span class="nx">renderLeft</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">var</span> <span class="nx">leftArrow</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">NAV_ARROW_LEFT</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
		<span class="c">// Check for deprecated customization - If someone set IMG_ROOT, but didn&#39;t set NAV_ARROW_LEFT, then set NAV_ARROW_LEFT to the old deprecated value</span>
<span class="c"></span>		<span class="k">if</span> <span class="o">(</span><span class="nx">leftArrow</span> <span class="o">===</span> <span class="kc">null</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">IMG_ROOT</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
			<span class="nx">leftArrow</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">IMG_ROOT</span> <span class="o">+</span> <span class="nx">DEPR_NAV_LEFT</span><span class="o">;</span>
		<span class="o">}</span>
		<span class="k">var</span> <span class="nx">leftStyle</span> <span class="o">=</span> <span class="o">(</span><span class="nx">leftArrow</span> <span class="o">===</span> <span class="kc">null</span><span class="o">)</span> <span class="o">?</span> <span class="s2">&quot;&quot;</span> <span class="o">:</span> <span class="s1">&#39; style=&quot;background-image:url(&#39;</span> <span class="o">+</span> <span class="nx">leftArrow</span> <span class="o">+</span> <span class="s1">&#39;)&quot;&#39;</span><span class="o">;</span>
		<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;a class=&quot;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_NAV_LEFT</span> <span class="o">+</span> <span class="s1">&#39;&quot;&#39;</span> <span class="o">+</span> <span class="nx">leftStyle</span> <span class="o">+</span> <span class="s1">&#39; &gt;&amp;#160;&lt;/a&gt;&#39;</span><span class="o">;</span>
	<span class="o">}</span>
	
	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">buildMonthLabel</span><span class="o">();</span>
	
	<span class="k">if</span> <span class="o">(</span><span class="nx">renderRight</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">var</span> <span class="nx">rightArrow</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">NAV_ARROW_RIGHT</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
		<span class="k">if</span> <span class="o">(</span><span class="nx">rightArrow</span> <span class="o">===</span> <span class="kc">null</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">IMG_ROOT</span> <span class="o">!==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
			<span class="nx">rightArrow</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">IMG_ROOT</span> <span class="o">+</span> <span class="nx">DEPR_NAV_RIGHT</span><span class="o">;</span>
		<span class="o">}</span>
		<span class="k">var</span> <span class="nx">rightStyle</span> <span class="o">=</span> <span class="o">(</span><span class="nx">rightArrow</span> <span class="o">===</span> <span class="kc">null</span><span class="o">)</span> <span class="o">?</span> <span class="s2">&quot;&quot;</span> <span class="o">:</span> <span class="s1">&#39; style=&quot;background-image:url(&#39;</span> <span class="o">+</span> <span class="nx">rightArrow</span> <span class="o">+</span> <span class="s1">&#39;)&quot;&#39;</span><span class="o">;</span>
		<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;a class=&quot;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_NAV_RIGHT</span> <span class="o">+</span> <span class="s1">&#39;&quot;&#39;</span> <span class="o">+</span> <span class="nx">rightStyle</span> <span class="o">+</span> <span class="s1">&#39; &gt;&amp;#160;&lt;/a&gt;&#39;</span><span class="o">;</span>
	<span class="o">}</span>

	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span>	<span class="s1">&#39;&lt;/div&gt;\n&lt;/th&gt;\n&lt;/tr&gt;&#39;</span><span class="o">;</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEKDAYS</span><span class="o">.</span><span class="nx">key</span><span class="o">))</span> <span class="o">{</span>
		<span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">buildWeekdays</span><span class="o">(</span><span class="nx">html</span><span class="o">);</span>
	<span class="o">}</span>
	
	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;/thead&gt;&#39;</span><span class="o">;</span>

	<span class="k">return</span> <span class="nx">html</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders the Calendar&#39;s weekday headers.</span>
<span class="c">* @method buildWeekdays</span>
<span class="c">* @param {Array}	html	The current working HTML array</span>
<span class="c">* @return {Array} The current working HTML array</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">buildWeekdays</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">html</span><span class="o">)</span> <span class="o">{</span>

	<span class="k">var</span> <span class="nx">defCfg</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">;</span>

	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;tr class=&quot;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_WEEKDAY_ROW</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span><span class="o">;</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEK_HEADER</span><span class="o">.</span><span class="nx">key</span><span class="o">))</span> <span class="o">{</span>
		<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;th&gt;&amp;#160;&lt;/th&gt;&#39;</span><span class="o">;</span>
	<span class="o">}</span>

	<span class="k">for</span><span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">i</span><span class="o">&lt;</span><span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span><span class="o">.</span><span class="nx">length</span><span class="o">;++</span><span class="nx">i</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;th class=&quot;calweekdaycell&quot;&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">LOCALE_WEEKDAYS</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">+</span> <span class="s1">&#39;&lt;/th&gt;&#39;</span><span class="o">;</span>
	<span class="o">}</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEK_FOOTER</span><span class="o">.</span><span class="nx">key</span><span class="o">))</span> <span class="o">{</span>
		<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;th&gt;&amp;#160;&lt;/th&gt;&#39;</span><span class="o">;</span>
	<span class="o">}</span>

	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;/tr&gt;&#39;</span><span class="o">;</span>

	<span class="k">return</span> <span class="nx">html</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders the calendar body.</span>
<span class="c">* @method renderBody</span>
<span class="c">* @param {Date}	workingDate	The current working Date being used for the render process</span>
<span class="c">* @param {Array}	html	The current working HTML array</span>
<span class="c">* @return {Array} The current working HTML array</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderBody</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">html</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Rendering body&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">defCfg</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">;</span>

	<span class="k">var</span> <span class="nx">startDay</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">START_WEEKDAY</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">preMonthDays</span> <span class="o">=</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDay</span><span class="o">();</span>
	<span class="k">if</span> <span class="o">(</span><span class="nx">startDay</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">preMonthDays</span> <span class="o">-=</span> <span class="nx">startDay</span><span class="o">;</span>
	<span class="o">}</span>
	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">preMonthDays</span> <span class="o">&lt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">preMonthDays</span> <span class="o">+=</span> <span class="m">7</span><span class="o">;</span>
	<span class="o">}</span>
	
	<span class="k">this</span><span class="o">.</span><span class="nx">monthDays</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">findMonthEnd</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">).</span><span class="nx">getDate</span><span class="o">();</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">postMonthDays</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">DISPLAY_DAYS</span><span class="o">-</span><span class="k">this</span><span class="o">.</span><span class="nx">preMonthDays</span><span class="o">-</span><span class="k">this</span><span class="o">.</span><span class="nx">monthDays</span><span class="o">;</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">preMonthDays</span> <span class="o">+</span> <span class="s2">&quot; preciding out-of-month days&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">monthDays</span> <span class="o">+</span> <span class="s2">&quot; month days&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">postMonthDays</span> <span class="o">+</span> <span class="s2">&quot; post-month days&quot;</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">);</span>
	
	<span class="nx">workingDate</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">subtract</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">DAY</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">preMonthDays</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Calendar page starts on &quot;</span> <span class="o">+</span> <span class="nx">workingDate</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">);</span>

	<span class="k">var</span> <span class="nx">weekNum</span><span class="o">,</span><span class="nx">weekClass</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">weekPrefix</span> <span class="o">=</span> <span class="s2">&quot;w&quot;</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">cellPrefix</span> <span class="o">=</span> <span class="s2">&quot;_cell&quot;</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">workingDayPrefix</span> <span class="o">=</span> <span class="s2">&quot;wd&quot;</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">dayPrefix</span> <span class="o">=</span> <span class="s2">&quot;d&quot;</span><span class="o">;</span>
	
	<span class="k">var</span> <span class="nx">cellRenderers</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">renderer</span><span class="o">;</span>
	
	<span class="k">var</span> <span class="nx">todayYear</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">today</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">();</span>
	<span class="k">var</span> <span class="nx">todayMonth</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">today</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">();</span>
	<span class="k">var</span> <span class="nx">todayDate</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">today</span><span class="o">.</span><span class="nx">getDate</span><span class="o">();</span>
	
	<span class="k">var</span> <span class="nx">useDate</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">hideBlankWeeks</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">HIDE_BLANK_WEEKS</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">showWeekFooter</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEK_FOOTER</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">showWeekHeader</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SHOW_WEEK_HEADER</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">mindate</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MINDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">maxdate</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MAXDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">mindate</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">mindate</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">clearTime</span><span class="o">(</span><span class="nx">mindate</span><span class="o">);</span>
	<span class="o">}</span>
	<span class="k">if</span> <span class="o">(</span><span class="nx">maxdate</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">maxdate</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">clearTime</span><span class="o">(</span><span class="nx">maxdate</span><span class="o">);</span>
	<span class="o">}</span>
	
	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;tbody class=&quot;m&#39;</span> <span class="o">+</span> <span class="o">(</span><span class="nx">useDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()+</span><span class="m">1</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39; &#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_BODY</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span><span class="o">;</span>
	
	<span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>

	<span class="k">var</span> <span class="nx">tempDiv</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;div&quot;</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">cell</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s2">&quot;td&quot;</span><span class="o">);</span>
	<span class="nx">tempDiv</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">cell</span><span class="o">);</span>

	<span class="k">var</span> <span class="nx">jan1</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">useDate</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">(),</span><span class="m">0</span><span class="o">,</span><span class="m">1</span><span class="o">);</span>

	<span class="k">var</span> <span class="nx">cal</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span> <span class="o">||</span> <span class="k">this</span><span class="o">;</span>

	<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">r</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">r</span><span class="o">&lt;</span><span class="m">6</span><span class="o">;</span><span class="nx">r</span><span class="o">++)</span> <span class="o">{</span>

		<span class="nx">weekNum</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">getWeekNumber</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">useDate</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">(),</span> <span class="nx">startDay</span><span class="o">);</span>
		<span class="nx">weekClass</span> <span class="o">=</span> <span class="nx">weekPrefix</span> <span class="o">+</span> <span class="nx">weekNum</span><span class="o">;</span>

		<span class="c">// Local OOM check for performance, since we already have pagedate</span>
<span class="c"></span>		<span class="k">if</span> <span class="o">(</span><span class="nx">r</span> <span class="o">!==</span> <span class="m">0</span> <span class="o">&amp;&amp;</span> <span class="nx">hideBlankWeeks</span> <span class="o">===</span> <span class="kc">true</span> <span class="o">&amp;&amp;</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()</span> <span class="o">!=</span> <span class="nx">useDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">())</span> <span class="o">{</span>
			<span class="k">break</span><span class="o">;</span>
		<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>

			<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;tr class=&quot;&#39;</span> <span class="o">+</span> <span class="nx">weekClass</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span><span class="o">;</span>
			
			<span class="k">if</span> <span class="o">(</span><span class="nx">showWeekHeader</span><span class="o">)</span> <span class="o">{</span> <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">renderRowHeader</span><span class="o">(</span><span class="nx">weekNum</span><span class="o">,</span> <span class="nx">html</span><span class="o">);</span> <span class="o">}</span>
			
			<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">d</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">d</span><span class="o">&lt;</span><span class="m">7</span><span class="o">;</span><span class="nx">d</span><span class="o">++){</span> <span class="c">// Render actual days</span>
<span class="c"></span>
				<span class="nx">cellRenderers</span> <span class="o">=</span> <span class="o">[];</span>
				<span class="nx">renderer</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>

				<span class="k">this</span><span class="o">.</span><span class="nx">clearElement</span><span class="o">(</span><span class="nx">cell</span><span class="o">);</span>
				<span class="nx">cell</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL</span><span class="o">;</span>
				<span class="nx">cell</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span> <span class="o">+</span> <span class="nx">cellPrefix</span> <span class="o">+</span> <span class="nx">i</span><span class="o">;</span>
				<span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Rendering cell &quot;</span> <span class="o">+</span> <span class="nx">cell</span><span class="o">.</span><span class="nx">id</span> <span class="o">+</span> <span class="s2">&quot; (&quot;</span> <span class="o">+</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">()</span> <span class="o">+</span> <span class="s2">&quot;-&quot;</span> <span class="o">+</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()+</span><span class="m">1</span><span class="o">)</span> <span class="o">+</span> <span class="s2">&quot;-&quot;</span> <span class="o">+</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDate</span><span class="o">()</span> <span class="o">+</span> <span class="s2">&quot;)&quot;</span><span class="o">,</span> <span class="s2">&quot;cellrender&quot;</span><span class="o">);</span>

				<span class="k">if</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDate</span><span class="o">()</span>		<span class="o">==</span> <span class="nx">todayDate</span> <span class="o">&amp;&amp;</span> 
					<span class="nx">workingDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()</span>		<span class="o">==</span> <span class="nx">todayMonth</span> <span class="o">&amp;&amp;</span>
					<span class="nx">workingDate</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">()</span>	<span class="o">==</span> <span class="nx">todayYear</span><span class="o">)</span> <span class="o">{</span>
					<span class="nx">cellRenderers</span><span class="o">[</span><span class="nx">cellRenderers</span><span class="o">.</span><span class="nx">length</span><span class="o">]=</span><span class="nx">cal</span><span class="o">.</span><span class="nx">renderCellStyleToday</span><span class="o">;</span>
				<span class="o">}</span>
				
				<span class="k">var</span> <span class="nx">workingArray</span> <span class="o">=</span> <span class="o">[</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">(),</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()+</span><span class="m">1</span><span class="o">,</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDate</span><span class="o">()];</span>
				<span class="k">this</span><span class="o">.</span><span class="nx">cellDates</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">cellDates</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">workingArray</span><span class="o">;</span> <span class="c">// Add this date to cellDates</span>
<span class="c"></span>				
				<span class="c">// Local OOM check for performance, since we already have pagedate</span>
<span class="c"></span>				<span class="k">if</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()</span> <span class="o">!=</span> <span class="nx">useDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">())</span> <span class="o">{</span>
					<span class="nx">cellRenderers</span><span class="o">[</span><span class="nx">cellRenderers</span><span class="o">.</span><span class="nx">length</span><span class="o">]=</span><span class="nx">cal</span><span class="o">.</span><span class="nx">renderCellNotThisMonth</span><span class="o">;</span>
				<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
					<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="nx">workingDayPrefix</span> <span class="o">+</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDay</span><span class="o">());</span>
					<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="nx">dayPrefix</span> <span class="o">+</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDate</span><span class="o">());</span>
				
					<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">s</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">s</span><span class="o">&lt;</span><span class="k">this</span><span class="o">.</span><span class="nx">renderStack</span><span class="o">.</span><span class="nx">length</span><span class="o">;++</span><span class="nx">s</span><span class="o">)</span> <span class="o">{</span>

						<span class="k">var</span> <span class="nx">rArray</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">renderStack</span><span class="o">[</span><span class="nx">s</span><span class="o">];</span>
						<span class="k">var</span> <span class="nx">type</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
						
						<span class="k">var</span> <span class="nx">month</span><span class="o">;</span>
						<span class="k">var</span> <span class="nx">day</span><span class="o">;</span>
						<span class="k">var</span> <span class="nx">year</span><span class="o">;</span>
						
						<span class="nx">switch</span> <span class="o">(</span><span class="nx">type</span><span class="o">)</span> <span class="o">{</span>
							<span class="nx">case</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">DATE</span><span class="o">:</span>
								<span class="nx">month</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">1</span><span class="o">][</span><span class="m">1</span><span class="o">];</span>
								<span class="nx">day</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">1</span><span class="o">][</span><span class="m">2</span><span class="o">];</span>
								<span class="nx">year</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">1</span><span class="o">][</span><span class="m">0</span><span class="o">];</span>

								<span class="k">if</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()+</span><span class="m">1</span> <span class="o">==</span> <span class="nx">month</span> <span class="o">&amp;&amp;</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDate</span><span class="o">()</span> <span class="o">==</span> <span class="nx">day</span> <span class="o">&amp;&amp;</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">()</span> <span class="o">==</span> <span class="nx">year</span><span class="o">)</span> <span class="o">{</span>
									<span class="nx">renderer</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">2</span><span class="o">];</span>
									<span class="k">this</span><span class="o">.</span><span class="nx">renderStack</span><span class="o">.</span><span class="nx">splice</span><span class="o">(</span><span class="nx">s</span><span class="o">,</span><span class="m">1</span><span class="o">);</span>
								<span class="o">}</span>
								<span class="k">break</span><span class="o">;</span>
							<span class="nx">case</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">MONTH_DAY</span><span class="o">:</span>
								<span class="nx">month</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">1</span><span class="o">][</span><span class="m">0</span><span class="o">];</span>
								<span class="nx">day</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">1</span><span class="o">][</span><span class="m">1</span><span class="o">];</span>
								
								<span class="k">if</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()+</span><span class="m">1</span> <span class="o">==</span> <span class="nx">month</span> <span class="o">&amp;&amp;</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDate</span><span class="o">()</span> <span class="o">==</span> <span class="nx">day</span><span class="o">)</span> <span class="o">{</span>
									<span class="nx">renderer</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">2</span><span class="o">];</span>
									<span class="k">this</span><span class="o">.</span><span class="nx">renderStack</span><span class="o">.</span><span class="nx">splice</span><span class="o">(</span><span class="nx">s</span><span class="o">,</span><span class="m">1</span><span class="o">);</span>
								<span class="o">}</span>
								<span class="k">break</span><span class="o">;</span>
							<span class="nx">case</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">RANGE</span><span class="o">:</span>
								<span class="k">var</span> <span class="nx">date1</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">1</span><span class="o">][</span><span class="m">0</span><span class="o">];</span>
								<span class="k">var</span> <span class="nx">date2</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">1</span><span class="o">][</span><span class="m">1</span><span class="o">];</span>

								<span class="k">var</span> <span class="nx">d1month</span> <span class="o">=</span> <span class="nx">date1</span><span class="o">[</span><span class="m">1</span><span class="o">];</span>
								<span class="k">var</span> <span class="nx">d1day</span> <span class="o">=</span> <span class="nx">date1</span><span class="o">[</span><span class="m">2</span><span class="o">];</span>
								<span class="k">var</span> <span class="nx">d1year</span> <span class="o">=</span> <span class="nx">date1</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
								
								<span class="k">var</span> <span class="nx">d1</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">d1year</span><span class="o">,</span> <span class="nx">d1month</span><span class="o">-</span><span class="m">1</span><span class="o">,</span> <span class="nx">d1day</span><span class="o">);</span>

								<span class="k">var</span> <span class="nx">d2month</span> <span class="o">=</span> <span class="nx">date2</span><span class="o">[</span><span class="m">1</span><span class="o">];</span>
								<span class="k">var</span> <span class="nx">d2day</span> <span class="o">=</span> <span class="nx">date2</span><span class="o">[</span><span class="m">2</span><span class="o">];</span>
								<span class="k">var</span> <span class="nx">d2year</span> <span class="o">=</span> <span class="nx">date2</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>

								<span class="k">var</span> <span class="nx">d2</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">d2year</span><span class="o">,</span> <span class="nx">d2month</span><span class="o">-</span><span class="m">1</span><span class="o">,</span> <span class="nx">d2day</span><span class="o">);</span>

								<span class="k">if</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getTime</span><span class="o">()</span> <span class="o">&gt;=</span> <span class="nx">d1</span><span class="o">.</span><span class="nx">getTime</span><span class="o">()</span> <span class="o">&amp;&amp;</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getTime</span><span class="o">()</span> <span class="o">&lt;=</span> <span class="nx">d2</span><span class="o">.</span><span class="nx">getTime</span><span class="o">())</span> <span class="o">{</span>
									<span class="nx">renderer</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">2</span><span class="o">];</span>

									<span class="k">if</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getTime</span><span class="o">()==</span><span class="nx">d2</span><span class="o">.</span><span class="nx">getTime</span><span class="o">())</span> <span class="o">{</span> 
										<span class="k">this</span><span class="o">.</span><span class="nx">renderStack</span><span class="o">.</span><span class="nx">splice</span><span class="o">(</span><span class="nx">s</span><span class="o">,</span><span class="m">1</span><span class="o">);</span>
									<span class="o">}</span>
								<span class="o">}</span>
								<span class="k">break</span><span class="o">;</span>
							<span class="nx">case</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">WEEKDAY</span><span class="o">:</span>
								
								<span class="k">var</span> <span class="nx">weekday</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">1</span><span class="o">][</span><span class="m">0</span><span class="o">];</span>
								<span class="k">if</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDay</span><span class="o">()+</span><span class="m">1</span> <span class="o">==</span> <span class="nx">weekday</span><span class="o">)</span> <span class="o">{</span>
									<span class="nx">renderer</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">2</span><span class="o">];</span>
								<span class="o">}</span>
								<span class="k">break</span><span class="o">;</span>
							<span class="nx">case</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">MONTH</span><span class="o">:</span>
								
								<span class="nx">month</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">1</span><span class="o">][</span><span class="m">0</span><span class="o">];</span>
								<span class="k">if</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()+</span><span class="m">1</span> <span class="o">==</span> <span class="nx">month</span><span class="o">)</span> <span class="o">{</span>
									<span class="nx">renderer</span> <span class="o">=</span> <span class="nx">rArray</span><span class="o">[</span><span class="m">2</span><span class="o">];</span>
								<span class="o">}</span>
								<span class="k">break</span><span class="o">;</span>
						<span class="o">}</span>
						
						<span class="k">if</span> <span class="o">(</span><span class="nx">renderer</span><span class="o">)</span> <span class="o">{</span>
							<span class="nx">cellRenderers</span><span class="o">[</span><span class="nx">cellRenderers</span><span class="o">.</span><span class="nx">length</span><span class="o">]=</span><span class="nx">renderer</span><span class="o">;</span>
						<span class="o">}</span>
					<span class="o">}</span>

				<span class="o">}</span>

				<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_indexOfSelectedFieldArray</span><span class="o">(</span><span class="nx">workingArray</span><span class="o">)</span> <span class="o">&gt;</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
					<span class="nx">cellRenderers</span><span class="o">[</span><span class="nx">cellRenderers</span><span class="o">.</span><span class="nx">length</span><span class="o">]=</span><span class="nx">cal</span><span class="o">.</span><span class="nx">renderCellStyleSelected</span><span class="o">;</span> 
				<span class="o">}</span>

				<span class="k">if</span> <span class="o">((</span><span class="nx">mindate</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getTime</span><span class="o">()</span> <span class="o">&lt;</span> <span class="nx">mindate</span><span class="o">.</span><span class="nx">getTime</span><span class="o">()))</span> <span class="o">||</span>
					<span class="o">(</span><span class="nx">maxdate</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getTime</span><span class="o">()</span> <span class="o">&gt;</span> <span class="nx">maxdate</span><span class="o">.</span><span class="nx">getTime</span><span class="o">()))</span>
				<span class="o">)</span> <span class="o">{</span>
					<span class="nx">cellRenderers</span><span class="o">[</span><span class="nx">cellRenderers</span><span class="o">.</span><span class="nx">length</span><span class="o">]=</span><span class="nx">cal</span><span class="o">.</span><span class="nx">renderOutOfBoundsDate</span><span class="o">;</span>
				<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
					<span class="nx">cellRenderers</span><span class="o">[</span><span class="nx">cellRenderers</span><span class="o">.</span><span class="nx">length</span><span class="o">]=</span><span class="nx">cal</span><span class="o">.</span><span class="nx">styleCellDefault</span><span class="o">;</span>
					<span class="nx">cellRenderers</span><span class="o">[</span><span class="nx">cellRenderers</span><span class="o">.</span><span class="nx">length</span><span class="o">]=</span><span class="nx">cal</span><span class="o">.</span><span class="nx">renderCellDefault</span><span class="o">;</span>	
				<span class="o">}</span>
				
				<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">x</span><span class="o">=</span><span class="m">0</span><span class="o">;</span> <span class="nx">x</span> <span class="o">&lt;</span> <span class="nx">cellRenderers</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="o">++</span><span class="nx">x</span><span class="o">)</span> <span class="o">{</span>
					<span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;renderer[&quot;</span> <span class="o">+</span> <span class="nx">x</span> <span class="o">+</span> <span class="s2">&quot;] for (&quot;</span> <span class="o">+</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">()</span> <span class="o">+</span> <span class="s2">&quot;-&quot;</span> <span class="o">+</span> <span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()+</span><span class="m">1</span><span class="o">)</span> <span class="o">+</span> <span class="s2">&quot;-&quot;</span> <span class="o">+</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDate</span><span class="o">()</span> <span class="o">+</span> <span class="s2">&quot;)&quot;</span><span class="o">,</span> <span class="s2">&quot;cellrender&quot;</span><span class="o">);</span>
					<span class="k">if</span> <span class="o">(</span><span class="nx">cellRenderers</span><span class="o">[</span><span class="nx">x</span><span class="o">].</span><span class="nx">call</span><span class="o">(</span><span class="nx">cal</span><span class="o">,</span> <span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">==</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">STOP_RENDER</span><span class="o">)</span> <span class="o">{</span>
						<span class="k">break</span><span class="o">;</span>
					<span class="o">}</span>
				<span class="o">}</span>

				<span class="nx">workingDate</span><span class="o">.</span><span class="nx">setTime</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getTime</span><span class="o">()</span> <span class="o">+</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">ONE_DAY_MS</span><span class="o">);</span>

				<span class="k">if</span> <span class="o">(</span><span class="nx">i</span> <span class="o">&gt;=</span> <span class="m">0</span> <span class="o">&amp;&amp;</span> <span class="nx">i</span> <span class="o">&lt;=</span> <span class="m">6</span><span class="o">)</span> <span class="o">{</span>
					<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_TOP</span><span class="o">);</span>
				<span class="o">}</span>
				<span class="k">if</span> <span class="o">((</span><span class="nx">i</span> <span class="o">%</span> <span class="m">7</span><span class="o">)</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
					<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_LEFT</span><span class="o">);</span>
				<span class="o">}</span>
				<span class="k">if</span> <span class="o">(((</span><span class="nx">i</span><span class="o">+</span><span class="m">1</span><span class="o">)</span> <span class="o">%</span> <span class="m">7</span><span class="o">)</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
					<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_RIGHT</span><span class="o">);</span>
				<span class="o">}</span>
				
				<span class="k">var</span> <span class="nx">postDays</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">postMonthDays</span><span class="o">;</span> 
				<span class="k">if</span> <span class="o">(</span><span class="nx">hideBlankWeeks</span> <span class="o">&amp;&amp;</span> <span class="nx">postDays</span> <span class="o">&gt;=</span> <span class="m">7</span><span class="o">)</span> <span class="o">{</span>
					<span class="k">var</span> <span class="nx">blankWeeks</span> <span class="o">=</span> <span class="nb">Math</span><span class="o">.</span><span class="nx">floor</span><span class="o">(</span><span class="nx">postDays</span><span class="o">/</span><span class="m">7</span><span class="o">);</span>
					<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">p</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">p</span><span class="o">&lt;</span><span class="nx">blankWeeks</span><span class="o">;++</span><span class="nx">p</span><span class="o">)</span> <span class="o">{</span>
						<span class="nx">postDays</span> <span class="o">-=</span> <span class="m">7</span><span class="o">;</span>
					<span class="o">}</span>
				<span class="o">}</span>
				
				<span class="k">if</span> <span class="o">(</span><span class="nx">i</span> <span class="o">&gt;=</span> <span class="o">((</span><span class="k">this</span><span class="o">.</span><span class="nx">preMonthDays</span><span class="o">+</span><span class="nx">postDays</span><span class="o">+</span><span class="k">this</span><span class="o">.</span><span class="nx">monthDays</span><span class="o">)-</span><span class="m">7</span><span class="o">))</span> <span class="o">{</span>
					<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_BOTTOM</span><span class="o">);</span>
				<span class="o">}</span>

				<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">tempDiv</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
				<span class="nx">i</span><span class="o">++;</span>
			<span class="o">}</span>

			<span class="k">if</span> <span class="o">(</span><span class="nx">showWeekFooter</span><span class="o">)</span> <span class="o">{</span> <span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">renderRowFooter</span><span class="o">(</span><span class="nx">weekNum</span><span class="o">,</span> <span class="nx">html</span><span class="o">);</span> <span class="o">}</span>

			<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;/tr&gt;&#39;</span><span class="o">;</span>
		<span class="o">}</span>
	<span class="o">}</span>

	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;/tbody&gt;&#39;</span><span class="o">;</span>

	<span class="k">return</span> <span class="nx">html</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders the calendar footer. In the default implementation, there is</span>
<span class="c">* no footer.</span>
<span class="c">* @method renderFooter</span>
<span class="c">* @param {Array}	html	The current working HTML array</span>
<span class="c">* @return {Array} The current working HTML array</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderFooter</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">html</span><span class="o">)</span> <span class="o">{</span> <span class="k">return</span> <span class="nx">html</span><span class="o">;</span> <span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders the calendar after it has been configured. The render() method has a specific call chain that will execute</span>
<span class="c">* when the method is called: renderHeader, renderBody, renderFooter.</span>
<span class="c">* Refer to the documentation for those methods for information on </span>
<span class="c">* individual render tasks.</span>
<span class="c">* @method render</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">render</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">beforeRenderEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>

	<span class="k">var</span> <span class="nx">defCfg</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">;</span>

	<span class="c">// Find starting day of the current month</span>
<span class="c"></span>	<span class="k">var</span> <span class="nx">workingDate</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">findMonthStart</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">));</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">resetRenderers</span><span class="o">();</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cellDates</span><span class="o">.</span><span class="nx">length</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>

	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">purgeElement</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

	<span class="k">var</span> <span class="nx">html</span> <span class="o">=</span> <span class="o">[];</span>

	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;table cellSpacing=&quot;0&quot; class=&quot;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CALENDAR</span> <span class="o">+</span> <span class="s1">&#39; y&#39;</span> <span class="o">+</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">()</span> <span class="o">+</span> <span class="s1">&#39;&quot; id=&quot;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span><span class="o">;</span>
	<span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">renderHeader</span><span class="o">(</span><span class="nx">html</span><span class="o">);</span>
	<span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">renderBody</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">html</span><span class="o">);</span>
	<span class="nx">html</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">renderFooter</span><span class="o">(</span><span class="nx">html</span><span class="o">);</span>
	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;/table&gt;&#39;</span><span class="o">;</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">html</span><span class="o">.</span><span class="nx">join</span><span class="o">(</span><span class="s2">&quot;\n&quot;</span><span class="o">);</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">applyListeners</span><span class="o">();</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cells</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">.</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s2">&quot;td&quot;</span><span class="o">);</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">TITLE</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">CLOSE</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">refireEvent</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">IFRAME</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">renderEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Applies the Calendar&#39;s DOM listeners to applicable elements.</span>
<span class="c">* @method applyListeners</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">applyListeners</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	
	<span class="k">var</span> <span class="nx">root</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">cal</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">parent</span> <span class="o">||</span> <span class="k">this</span><span class="o">;</span>
	
	<span class="k">var</span> <span class="nx">anchor</span> <span class="o">=</span> <span class="s2">&quot;a&quot;</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">mousedown</span> <span class="o">=</span> <span class="s2">&quot;mousedown&quot;</span><span class="o">;</span>

	<span class="k">var</span> <span class="nx">linkLeft</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getElementsByClassName</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_NAV_LEFT</span><span class="o">,</span> <span class="nx">anchor</span><span class="o">,</span> <span class="nx">root</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">linkRight</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getElementsByClassName</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_NAV_RIGHT</span><span class="o">,</span> <span class="nx">anchor</span><span class="o">,</span> <span class="nx">root</span><span class="o">);</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">linkLeft</span> <span class="o">&amp;&amp;</span> <span class="nx">linkLeft</span><span class="o">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">linkLeft</span> <span class="o">=</span> <span class="nx">linkLeft</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
		<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">addListener</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">linkLeft</span><span class="o">,</span> <span class="nx">mousedown</span><span class="o">,</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">previousMonth</span><span class="o">,</span> <span class="nx">cal</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="o">}</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">linkRight</span> <span class="o">&amp;&amp;</span> <span class="nx">linkRight</span><span class="o">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">linkRight</span> <span class="o">=</span> <span class="nx">linkRight</span><span class="o">[</span><span class="m">0</span><span class="o">];</span>
		<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">addListener</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">linkRight</span><span class="o">,</span> <span class="nx">mousedown</span><span class="o">,</span> <span class="nx">cal</span><span class="o">.</span><span class="nx">nextMonth</span><span class="o">,</span> <span class="nx">cal</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
	<span class="o">}</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">domEventMap</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">var</span> <span class="nx">el</span><span class="o">,</span><span class="nx">elements</span><span class="o">;</span>
		<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">cls</span> <span class="k">in</span> <span class="k">this</span><span class="o">.</span><span class="nx">domEventMap</span><span class="o">)</span> <span class="o">{</span>	
			<span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">domEventMap</span><span class="o">,</span> <span class="nx">cls</span><span class="o">))</span> <span class="o">{</span>
				<span class="k">var</span> <span class="nx">items</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">domEventMap</span><span class="o">[</span><span class="nx">cls</span><span class="o">];</span>

				<span class="k">if</span> <span class="o">(!</span> <span class="o">(</span><span class="nx">items</span> <span class="k">instanceof</span> <span class="nb">Array</span><span class="o">))</span> <span class="o">{</span>
					<span class="nx">items</span> <span class="o">=</span> <span class="o">[</span><span class="nx">items</span><span class="o">];</span>
				<span class="o">}</span>

				<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">i</span><span class="o">&lt;</span><span class="nx">items</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span><span class="nx">i</span><span class="o">++)</span>	<span class="o">{</span>
					<span class="k">var</span> <span class="nx">item</span> <span class="o">=</span> <span class="nx">items</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
					<span class="nx">elements</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">getElementsByClassName</span><span class="o">(</span><span class="nx">cls</span><span class="o">,</span> <span class="nx">item</span><span class="o">.</span><span class="nx">tag</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">);</span>

					<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">c</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">c</span><span class="o">&lt;</span><span class="nx">elements</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span><span class="nx">c</span><span class="o">++)</span> <span class="o">{</span>
						<span class="nx">el</span> <span class="o">=</span> <span class="nx">elements</span><span class="o">[</span><span class="nx">c</span><span class="o">];</span>
						 <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">addListener</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">item</span><span class="o">.</span><span class="nx">event</span><span class="o">,</span> <span class="nx">item</span><span class="o">.</span><span class="nx">handler</span><span class="o">,</span> <span class="nx">item</span><span class="o">.</span><span class="nx">scope</span><span class="o">,</span> <span class="nx">item</span><span class="o">.</span><span class="nx">correct</span> <span class="o">);</span>
					<span class="o">}</span>
				<span class="o">}</span>
			<span class="o">}</span>
		<span class="o">}</span>
	<span class="o">}</span>

	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">addListener</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">,</span> <span class="s2">&quot;click&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">doSelectCell</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">addListener</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">,</span> <span class="s2">&quot;mouseover&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">doCellMouseOver</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">addListener</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">,</span> <span class="s2">&quot;mouseout&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">doCellMouseOut</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Retrieves the Date object for the specified Calendar cell</span>
<span class="c">* @method getDateByCellId</span>
<span class="c">* @param {String}	id	The id of the cell</span>
<span class="c">* @return {Date} The Date object for the specified Calendar cell</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">getDateByCellId</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">date</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getDateFieldsByCellId</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
	<span class="k">return</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">date</span><span class="o">[</span><span class="m">0</span><span class="o">],</span><span class="nx">date</span><span class="o">[</span><span class="m">1</span><span class="o">]-</span><span class="m">1</span><span class="o">,</span><span class="nx">date</span><span class="o">[</span><span class="m">2</span><span class="o">]);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Retrieves the Date object for the specified Calendar cell</span>
<span class="c">* @method getDateFieldsByCellId</span>
<span class="c">* @param {String}	id	The id of the cell</span>
<span class="c">* @return {Array}	The array of Date fields for the specified Calendar cell</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">getDateFieldsByCellId</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">id</span> <span class="o">=</span> <span class="nx">id</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">().</span><span class="nx">split</span><span class="o">(</span><span class="s2">&quot;_cell&quot;</span><span class="o">)[</span><span class="m">1</span><span class="o">];</span>
	<span class="nx">id</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">id</span><span class="o">,</span> <span class="m">10</span><span class="o">);</span>
	<span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">cellDates</span><span class="o">[</span><span class="nx">id</span><span class="o">];</span>
<span class="o">};</span>

<span class="c">// BEGIN BUILT-IN TABLE CELL RENDERERS</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c">* Renders a cell that falls before the minimum date or after the maximum date.</span>
<span class="c">* widget class.</span>
<span class="c">* @method renderOutOfBoundsDate</span>
<span class="c">* @param {Date}					workingDate		The current working Date object being used to generate the calendar</span>
<span class="c">* @param {HTMLTableCellElement}	cell			The current working cell in the calendar</span>
<span class="c">* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering</span>
<span class="c">*			should not be terminated</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderOutOfBoundsDate</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_OOB</span><span class="o">);</span>
	<span class="nx">cell</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDate</span><span class="o">();</span>
	<span class="k">return</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">STOP_RENDER</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders the row header for a week.</span>
<span class="c">* @method renderRowHeader</span>
<span class="c">* @param {Number}	weekNum	The week number of the current row</span>
<span class="c">* @param {Array}	cell	The current working HTML array</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderRowHeader</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">weekNum</span><span class="o">,</span> <span class="nx">html</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;th class=&quot;calrowhead&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">weekNum</span> <span class="o">+</span> <span class="s1">&#39;&lt;/th&gt;&#39;</span><span class="o">;</span>
	<span class="k">return</span> <span class="nx">html</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders the row footer for a week.</span>
<span class="c">* @method renderRowFooter</span>
<span class="c">* @param {Number}	weekNum	The week number of the current row</span>
<span class="c">* @param {Array}	cell	The current working HTML array</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderRowFooter</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">weekNum</span><span class="o">,</span> <span class="nx">html</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">html</span><span class="o">[</span><span class="nx">html</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="s1">&#39;&lt;th class=&quot;calrowfoot&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">weekNum</span> <span class="o">+</span> <span class="s1">&#39;&lt;/th&gt;&#39;</span><span class="o">;</span>
	<span class="k">return</span> <span class="nx">html</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders a single standard calendar cell in the calendar widget table.</span>
<span class="c">* All logic for determining how a standard default cell will be rendered is </span>
<span class="c">* encapsulated in this method, and must be accounted for when extending the</span>
<span class="c">* widget class.</span>
<span class="c">* @method renderCellDefault</span>
<span class="c">* @param {Date}					workingDate		The current working Date object being used to generate the calendar</span>
<span class="c">* @param {HTMLTableCellElement}	cell			The current working cell in the calendar</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderCellDefault</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">cell</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&lt;a href=&quot;#&quot; class=&quot;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTOR</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">buildDayLabel</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">)</span> <span class="o">+</span> <span class="s2">&quot;&lt;/a&gt;&quot;</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Styles a selectable cell.</span>
<span class="c">* @method styleCellDefault</span>
<span class="c">* @param {Date}					workingDate		The current working Date object being used to generate the calendar</span>
<span class="c">* @param {HTMLTableCellElement}	cell			The current working cell in the calendar</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">styleCellDefault</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTABLE</span><span class="o">);</span>
<span class="o">};</span>


<span class="c">/**</span>
<span class="c">* Renders a single standard calendar cell using the CSS hightlight1 style</span>
<span class="c">* @method renderCellStyleHighlight1</span>
<span class="c">* @param {Date}					workingDate		The current working Date object being used to generate the calendar</span>
<span class="c">* @param {HTMLTableCellElement}	cell			The current working cell in the calendar</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderCellStyleHighlight1</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_HIGHLIGHT1</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders a single standard calendar cell using the CSS hightlight2 style</span>
<span class="c">* @method renderCellStyleHighlight2</span>
<span class="c">* @param {Date}					workingDate		The current working Date object being used to generate the calendar</span>
<span class="c">* @param {HTMLTableCellElement}	cell			The current working cell in the calendar</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderCellStyleHighlight2</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_HIGHLIGHT2</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders a single standard calendar cell using the CSS hightlight3 style</span>
<span class="c">* @method renderCellStyleHighlight3</span>
<span class="c">* @param {Date}					workingDate		The current working Date object being used to generate the calendar</span>
<span class="c">* @param {HTMLTableCellElement}	cell			The current working cell in the calendar</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderCellStyleHighlight3</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_HIGHLIGHT3</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders a single standard calendar cell using the CSS hightlight4 style</span>
<span class="c">* @method renderCellStyleHighlight4</span>
<span class="c">* @param {Date}					workingDate		The current working Date object being used to generate the calendar</span>
<span class="c">* @param {HTMLTableCellElement}	cell			The current working cell in the calendar</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderCellStyleHighlight4</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_HIGHLIGHT4</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Applies the default style used for rendering today&#39;s date to the current calendar cell</span>
<span class="c">* @method renderCellStyleToday</span>
<span class="c">* @param {Date}					workingDate		The current working Date object being used to generate the calendar</span>
<span class="c">* @param {HTMLTableCellElement}	cell			The current working cell in the calendar</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderCellStyleToday</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_TODAY</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Applies the default style used for rendering selected dates to the current calendar cell</span>
<span class="c">* @method renderCellStyleSelected</span>
<span class="c">* @param {Date}					workingDate		The current working Date object being used to generate the calendar</span>
<span class="c">* @param {HTMLTableCellElement}	cell			The current working cell in the calendar</span>
<span class="c">* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering</span>
<span class="c">*			should not be terminated</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderCellStyleSelected</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTED</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Applies the default style used for rendering dates that are not a part of the current</span>
<span class="c">* month (preceding or trailing the cells for the current month)</span>
<span class="c">* @method renderCellNotThisMonth</span>
<span class="c">* @param {Date}					workingDate		The current working Date object being used to generate the calendar</span>
<span class="c">* @param {HTMLTableCellElement}	cell			The current working cell in the calendar</span>
<span class="c">* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering</span>
<span class="c">*			should not be terminated</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderCellNotThisMonth</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_OOM</span><span class="o">);</span>
	<span class="nx">cell</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">=</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDate</span><span class="o">();</span>
	<span class="k">return</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">STOP_RENDER</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Renders the current calendar cell as a non-selectable &quot;black-out&quot; date using the default</span>
<span class="c">* restricted style.</span>
<span class="c">* @method renderBodyCellRestricted</span>
<span class="c">* @param {Date}					workingDate		The current working Date object being used to generate the calendar</span>
<span class="c">* @param {HTMLTableCellElement}	cell			The current working cell in the calendar</span>
<span class="c">* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering</span>
<span class="c">*			should not be terminated</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">renderBodyCellRestricted</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">workingDate</span><span class="o">,</span> <span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL</span><span class="o">);</span>
	<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_RESTRICTED</span><span class="o">);</span>
	<span class="nx">cell</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">=</span><span class="nx">workingDate</span><span class="o">.</span><span class="nx">getDate</span><span class="o">();</span>
	<span class="k">return</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">STOP_RENDER</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">// END BUILT-IN TABLE CELL RENDERERS</span>
<span class="c"></span>
<span class="c">// BEGIN MONTH NAVIGATION METHODS</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c">* Adds the designated number of months to the current calendar month, and sets the current</span>
<span class="c">* calendar page date to the new month.</span>
<span class="c">* @method addMonths</span>
<span class="c">* @param {Number}	count	The number of months to add to the current calendar</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">addMonths</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">count</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">cfgPageDate</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">add</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">),</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">MONTH</span><span class="o">,</span> <span class="nx">count</span><span class="o">));</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">resetRenderers</span><span class="o">();</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">changePageEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Subtracts the designated number of months from the current calendar month, and sets the current</span>
<span class="c">* calendar page date to the new month.</span>
<span class="c">* @method subtractMonths</span>
<span class="c">* @param {Number}	count	The number of months to subtract from the current calendar</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">subtractMonths</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">count</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">cfgPageDate</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">subtract</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">),</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">MONTH</span><span class="o">,</span> <span class="nx">count</span><span class="o">));</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">resetRenderers</span><span class="o">();</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">changePageEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Adds the designated number of years to the current calendar, and sets the current</span>
<span class="c">* calendar page date to the new month.</span>
<span class="c">* @method addYears</span>
<span class="c">* @param {Number}	count	The number of years to add to the current calendar</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">addYears</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">count</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">cfgPageDate</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">add</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">),</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">YEAR</span><span class="o">,</span> <span class="nx">count</span><span class="o">));</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">resetRenderers</span><span class="o">();</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">changePageEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Subtcats the designated number of years from the current calendar, and sets the current</span>
<span class="c">* calendar page date to the new month.</span>
<span class="c">* @method subtractYears</span>
<span class="c">* @param {Number}	count	The number of years to subtract from the current calendar</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">subtractYears</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">count</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">cfgPageDate</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">subtract</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">),</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">YEAR</span><span class="o">,</span> <span class="nx">count</span><span class="o">));</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">resetRenderers</span><span class="o">();</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">changePageEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Navigates to the next month page in the calendar widget.</span>
<span class="c">* @method nextMonth</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">nextMonth</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">addMonths</span><span class="o">(</span><span class="m">1</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Navigates to the previous month page in the calendar widget.</span>
<span class="c">* @method previousMonth</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">previousMonth</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">subtractMonths</span><span class="o">(</span><span class="m">1</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Navigates to the next year in the currently selected month in the calendar widget.</span>
<span class="c">* @method nextYear</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">nextYear</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">addYears</span><span class="o">(</span><span class="m">1</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Navigates to the previous year in the currently selected month in the calendar widget.</span>
<span class="c">* @method previousYear</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">previousYear</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">subtractYears</span><span class="o">(</span><span class="m">1</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">// END MONTH NAVIGATION METHODS</span>
<span class="c"></span>
<span class="c">// BEGIN SELECTION METHODS</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c">* Resets the calendar widget to the originally selected month and year, and </span>
<span class="c">* sets the calendar to the initial selection(s).</span>
<span class="c">* @method reset</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">reset</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">defCfg</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">;</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">resetProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">resetProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">resetEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Clears the selected dates in the current calendar widget and sets the calendar</span>
<span class="c">* to the current month and year.</span>
<span class="c">* @method clear</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">clear</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">defCfg</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">;</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="o">[]);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">today</span><span class="o">.</span><span class="nx">getTime</span><span class="o">()));</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">clearEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Selects a date or a collection of dates on the current calendar. This method, by default,</span>
<span class="c">* does not call the render method explicitly. Once selection has completed, render must be </span>
<span class="c">* called for the changes to be reflected visually.</span>
<span class="c">* @method select</span>
<span class="c">* @param	{String/Date/Date[]}	date	The date string of dates to select in the current calendar. Valid formats are</span>
<span class="c">*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).</span>
<span class="c">*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).</span>
<span class="c">*								This method can also take a JavaScript Date object or an array of Date objects.</span>
<span class="c">* @return	{Date[]}			Array of JavaScript Date objects representing all individual dates that are currently selected.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">select</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">date</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Select: &quot;</span> <span class="o">+</span> <span class="nx">date</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">beforeSelectEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
	
	<span class="k">var</span> <span class="nx">cfgSelected</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>

	<span class="k">var</span> <span class="nx">selected</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">aToBeSelected</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_toFieldArray</span><span class="o">(</span><span class="nx">date</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Selection field array: &quot;</span> <span class="o">+</span> <span class="nx">aToBeSelected</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">);</span>

	<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">a</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">a</span><span class="o">&lt;</span><span class="nx">aToBeSelected</span><span class="o">.</span><span class="nx">length</span><span class="o">;++</span><span class="nx">a</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">var</span> <span class="nx">toSelect</span> <span class="o">=</span> <span class="nx">aToBeSelected</span><span class="o">[</span><span class="nx">a</span><span class="o">];</span> <span class="c">// For each date item in the list of dates we&#39;re trying to select</span>
<span class="c"></span>		<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_indexOfSelectedFieldArray</span><span class="o">(</span><span class="nx">toSelect</span><span class="o">)</span> <span class="o">==</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span> <span class="c">// not already selected?</span>
<span class="c"></span>			<span class="nx">selected</span><span class="o">[</span><span class="nx">selected</span><span class="o">.</span><span class="nx">length</span><span class="o">]=</span><span class="nx">toSelect</span><span class="o">;</span>
		<span class="o">}</span>
	<span class="o">}</span>
	
	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">,</span> <span class="nx">selected</span><span class="o">);</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">,</span> <span class="nx">selected</span><span class="o">);</span>
	<span class="o">}</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">selectEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="nx">aToBeSelected</span><span class="o">);</span>
	
	<span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getSelectedDates</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Selects a date on the current calendar by referencing the index of the cell that should be selected.</span>
<span class="c">* This method is used to easily select a single cell (usually with a mouse click) without having to do</span>
<span class="c">* a full render. The selected style is applied to the cell directly.</span>
<span class="c">* @method selectCell</span>
<span class="c">* @param	{Number}	cellIndex	The index of the cell to select in the current calendar. </span>
<span class="c">* @return	{Date[]}	Array of JavaScript Date objects representing all individual dates that are currently selected.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">selectCell</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">cellIndex</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">beforeSelectEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
	
	<span class="k">var</span> <span class="nx">cfgSelected</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">selected</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">);</span>

	<span class="k">var</span> <span class="nx">cell</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cells</span><span class="o">[</span><span class="nx">cellIndex</span><span class="o">];</span>
	<span class="k">var</span> <span class="nx">cellDate</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cellDates</span><span class="o">[</span><span class="nx">cellIndex</span><span class="o">];</span>

	<span class="k">var</span> <span class="nx">dCellDate</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_toDate</span><span class="o">(</span><span class="nx">cellDate</span><span class="o">);</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">logger</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s2">&quot;Select: &quot;</span> <span class="o">+</span> <span class="nx">dCellDate</span><span class="o">,</span> <span class="s2">&quot;info&quot;</span><span class="o">);</span>

	<span class="k">var</span> <span class="nx">selectDate</span> <span class="o">=</span> <span class="nx">cellDate</span><span class="o">.</span><span class="nx">concat</span><span class="o">();</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_indexOfSelectedFieldArray</span><span class="o">(</span><span class="nx">selectDate</span><span class="o">)</span> <span class="o">==</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">selected</span><span class="o">[</span><span class="nx">selected</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">selectDate</span><span class="o">;</span>
	<span class="o">}</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">,</span> <span class="nx">selected</span><span class="o">);</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">,</span> <span class="nx">selected</span><span class="o">);</span>
	<span class="o">}</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">renderCellStyleSelected</span><span class="o">(</span><span class="nx">dCellDate</span><span class="o">,</span><span class="nx">cell</span><span class="o">);</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">selectEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">([</span><span class="nx">selectDate</span><span class="o">]);</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">doCellMouseOut</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="kc">null</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>

	<span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getSelectedDates</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Deselects a date or a collection of dates on the current calendar. This method, by default,</span>
<span class="c">* does not call the render method explicitly. Once deselection has completed, render must be </span>
<span class="c">* called for the changes to be reflected visually.</span>
<span class="c">* @method deselect</span>
<span class="c">* @param	{String/Date/Date[]}	date	The date string of dates to deselect in the current calendar. Valid formats are</span>
<span class="c">*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).</span>
<span class="c">*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).</span>
<span class="c">*								This method can also take a JavaScript Date object or an array of Date objects.	</span>
<span class="c">* @return	{Date[]}			Array of JavaScript Date objects representing all individual dates that are currently selected.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">deselect</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">date</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">beforeDeselectEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
	<span class="k">var</span> <span class="nx">cfgSelected</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>

	<span class="k">var</span> <span class="nx">selected</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">);</span>

	<span class="k">var</span> <span class="nx">aToBeSelected</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_toFieldArray</span><span class="o">(</span><span class="nx">date</span><span class="o">);</span>

	<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">a</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">a</span><span class="o">&lt;</span><span class="nx">aToBeSelected</span><span class="o">.</span><span class="nx">length</span><span class="o">;++</span><span class="nx">a</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">var</span> <span class="nx">toSelect</span> <span class="o">=</span> <span class="nx">aToBeSelected</span><span class="o">[</span><span class="nx">a</span><span class="o">];</span> <span class="c">// For each date item in the list of dates we&#39;re trying to select</span>
<span class="c"></span>		<span class="k">var</span> <span class="nx">index</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_indexOfSelectedFieldArray</span><span class="o">(</span><span class="nx">toSelect</span><span class="o">);</span>
	
		<span class="k">if</span> <span class="o">(</span><span class="nx">index</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>	
			<span class="nx">selected</span><span class="o">.</span><span class="nx">splice</span><span class="o">(</span><span class="nx">index</span><span class="o">,</span><span class="m">1</span><span class="o">);</span>
		<span class="o">}</span>
	<span class="o">}</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">,</span> <span class="nx">selected</span><span class="o">);</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">,</span> <span class="nx">selected</span><span class="o">);</span>
	<span class="o">}</span>

	<span class="k">this</span><span class="o">.</span><span class="nx">deselectEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="nx">aToBeSelected</span><span class="o">);</span>
	
	<span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getSelectedDates</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.</span>
<span class="c">* This method is used to easily deselect a single cell (usually with a mouse click) without having to do</span>
<span class="c">* a full render. The selected style is removed from the cell directly.</span>
<span class="c">* @method deselectCell</span>
<span class="c">* @param	{Number}	cellIndex	The index of the cell to deselect in the current calendar. </span>
<span class="c">* @return	{Date[]}	Array of JavaScript Date objects representing all individual dates that are currently selected.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">deselectCell</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">i</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">beforeDeselectEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
	
	<span class="k">var</span> <span class="nx">defCfg</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">;</span>
	
	<span class="k">var</span> <span class="nx">selected</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>

	<span class="k">var</span> <span class="nx">cell</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cells</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
	<span class="k">var</span> <span class="nx">cellDate</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cellDates</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
	<span class="k">var</span> <span class="nx">cellDateIndex</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_indexOfSelectedFieldArray</span><span class="o">(</span><span class="nx">cellDate</span><span class="o">);</span>

	<span class="k">var</span> <span class="nx">dCellDate</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_toDate</span><span class="o">(</span><span class="nx">cellDate</span><span class="o">);</span>

	<span class="k">var</span> <span class="nx">selectDate</span> <span class="o">=</span> <span class="nx">cellDate</span><span class="o">.</span><span class="nx">concat</span><span class="o">();</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">cellDateIndex</span> <span class="o">&gt;</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">).</span><span class="nx">getMonth</span><span class="o">()</span> <span class="o">==</span> <span class="nx">dCellDate</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()</span> <span class="o">&amp;&amp;</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">).</span><span class="nx">getFullYear</span><span class="o">()</span> <span class="o">==</span> <span class="nx">dCellDate</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">())</span> <span class="o">{</span>
			<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">cell</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTED</span><span class="o">);</span>
		<span class="o">}</span>

		<span class="nx">selected</span><span class="o">.</span><span class="nx">splice</span><span class="o">(</span><span class="nx">cellDateIndex</span><span class="o">,</span> <span class="m">1</span><span class="o">);</span>
	<span class="o">}</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="nx">selected</span><span class="o">);</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">,</span> <span class="nx">selected</span><span class="o">);</span>
	<span class="o">}</span>
	
	<span class="k">this</span><span class="o">.</span><span class="nx">deselectEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="nx">selectDate</span><span class="o">);</span>
	<span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getSelectedDates</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Deselects all dates on the current calendar.</span>
<span class="c">* @method deselectAll</span>
<span class="c">* @return {Date[]}		Array of JavaScript Date objects representing all individual dates that are currently selected.</span>
<span class="c">*						Assuming that this function executes properly, the return value should be an empty array.</span>
<span class="c">*						However, the empty array is returned for the sake of being able to check the selection status</span>
<span class="c">*						of the calendar.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">deselectAll</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">beforeDeselectEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">();</span>
	
	<span class="k">var</span> <span class="nx">cfgSelected</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>

	<span class="k">var</span> <span class="nx">selected</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">count</span> <span class="o">=</span> <span class="nx">selected</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">sel</span> <span class="o">=</span> <span class="nx">selected</span><span class="o">.</span><span class="nx">concat</span><span class="o">();</span>

	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">,</span> <span class="o">[]);</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgSelected</span><span class="o">,</span> <span class="o">[]);</span>
	<span class="o">}</span>
	
	<span class="k">if</span> <span class="o">(</span><span class="nx">count</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">this</span><span class="o">.</span><span class="nx">deselectEvent</span><span class="o">.</span><span class="nx">fire</span><span class="o">(</span><span class="nx">sel</span><span class="o">);</span>
	<span class="o">}</span>

	<span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getSelectedDates</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">// END SELECTION METHODS</span>
<span class="c"></span>
<span class="c">// BEGIN TYPE CONVERSION METHODS</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c">* Converts a date (either a JavaScript Date object, or a date string) to the internal data structure</span>
<span class="c">* used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].</span>
<span class="c">* @method _toFieldArray</span>
<span class="c">* @private</span>
<span class="c">* @param	{String/Date/Date[]}	date	The date string of dates to deselect in the current calendar. Valid formats are</span>
<span class="c">*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).</span>
<span class="c">*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).</span>
<span class="c">*								This method can also take a JavaScript Date object or an array of Date objects.	</span>
<span class="c">* @return {Array[](Number[])}	Array of date field arrays</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">_toFieldArray</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">date</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">returnDate</span> <span class="o">=</span> <span class="o">[];</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">date</span> <span class="k">instanceof</span> <span class="nb">Date</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">returnDate</span> <span class="o">=</span> <span class="o">[[</span><span class="nx">date</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">(),</span> <span class="nx">date</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()+</span><span class="m">1</span><span class="o">,</span> <span class="nx">date</span><span class="o">.</span><span class="nx">getDate</span><span class="o">()]];</span>
	<span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">date</span><span class="o">))</span> <span class="o">{</span>
		<span class="nx">returnDate</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_parseDates</span><span class="o">(</span><span class="nx">date</span><span class="o">);</span>
	<span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">date</span><span class="o">))</span> <span class="o">{</span>
		<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">i</span><span class="o">&lt;</span><span class="nx">date</span><span class="o">.</span><span class="nx">length</span><span class="o">;++</span><span class="nx">i</span><span class="o">)</span> <span class="o">{</span>
			<span class="k">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">date</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
			<span class="nx">returnDate</span><span class="o">[</span><span class="nx">returnDate</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="o">[</span><span class="nx">d</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">(),</span><span class="nx">d</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()+</span><span class="m">1</span><span class="o">,</span><span class="nx">d</span><span class="o">.</span><span class="nx">getDate</span><span class="o">()];</span>
		<span class="o">}</span>
	<span class="o">}</span>
	
	<span class="k">return</span> <span class="nx">returnDate</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.</span>
<span class="c">* @method _toDate</span>
<span class="c">* @private</span>
<span class="c">* @param	{Number[]}		dateFieldArray	The date field array to convert to a JavaScript Date.</span>
<span class="c">* @return	{Date}	JavaScript Date object representing the date field array</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">_toDate</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">dateFieldArray</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">if</span> <span class="o">(</span><span class="nx">dateFieldArray</span> <span class="k">instanceof</span> <span class="nb">Date</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">return</span> <span class="nx">dateFieldArray</span><span class="o">;</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="k">return</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">dateFieldArray</span><span class="o">[</span><span class="m">0</span><span class="o">],</span><span class="nx">dateFieldArray</span><span class="o">[</span><span class="m">1</span><span class="o">]-</span><span class="m">1</span><span class="o">,</span><span class="nx">dateFieldArray</span><span class="o">[</span><span class="m">2</span><span class="o">]);</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">// END TYPE CONVERSION METHODS </span>
<span class="c"></span>
<span class="c">// BEGIN UTILITY METHODS</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c">* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.</span>
<span class="c">* @method _fieldArraysAreEqual</span>
<span class="c">* @private</span>
<span class="c">* @param	{Number[]}	array1	The first date field array to compare</span>
<span class="c">* @param	{Number[]}	array2	The first date field array to compare</span>
<span class="c">* @return	{Boolean}	The boolean that represents the equality of the two arrays</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">_fieldArraysAreEqual</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">array1</span><span class="o">,</span> <span class="nx">array2</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">match</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">array1</span><span class="o">[</span><span class="m">0</span><span class="o">]==</span><span class="nx">array2</span><span class="o">[</span><span class="m">0</span><span class="o">]&amp;&amp;</span><span class="nx">array1</span><span class="o">[</span><span class="m">1</span><span class="o">]==</span><span class="nx">array2</span><span class="o">[</span><span class="m">1</span><span class="o">]&amp;&amp;</span><span class="nx">array1</span><span class="o">[</span><span class="m">2</span><span class="o">]==</span><span class="nx">array2</span><span class="o">[</span><span class="m">2</span><span class="o">])</span> <span class="o">{</span>
		<span class="nx">match</span><span class="o">=</span><span class="kc">true</span><span class="o">;</span>	
	<span class="o">}</span>

	<span class="k">return</span> <span class="nx">match</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.</span>
<span class="c">* @method	_indexOfSelectedFieldArray</span>
<span class="c">* @private</span>
<span class="c">* @param	{Number[]}		find	The date field array to search for</span>
<span class="c">* @return	{Number}			The index of the date field array within the collection of selected dates.</span>
<span class="c">*								-1 will be returned if the date is not found.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">_indexOfSelectedFieldArray</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">find</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">selected</span> <span class="o">=</span> <span class="o">-</span><span class="m">1</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">seldates</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>

	<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">s</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">s</span><span class="o">&lt;</span><span class="nx">seldates</span><span class="o">.</span><span class="nx">length</span><span class="o">;++</span><span class="nx">s</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">var</span> <span class="nx">sArray</span> <span class="o">=</span> <span class="nx">seldates</span><span class="o">[</span><span class="nx">s</span><span class="o">];</span>
		<span class="k">if</span> <span class="o">(</span><span class="nx">find</span><span class="o">[</span><span class="m">0</span><span class="o">]==</span><span class="nx">sArray</span><span class="o">[</span><span class="m">0</span><span class="o">]&amp;&amp;</span><span class="nx">find</span><span class="o">[</span><span class="m">1</span><span class="o">]==</span><span class="nx">sArray</span><span class="o">[</span><span class="m">1</span><span class="o">]&amp;&amp;</span><span class="nx">find</span><span class="o">[</span><span class="m">2</span><span class="o">]==</span><span class="nx">sArray</span><span class="o">[</span><span class="m">2</span><span class="o">])</span> <span class="o">{</span>
			<span class="nx">selected</span> <span class="o">=</span> <span class="nx">s</span><span class="o">;</span>
			<span class="k">break</span><span class="o">;</span>
		<span class="o">}</span>
	<span class="o">}</span>

	<span class="k">return</span> <span class="nx">selected</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Determines whether a given date is OOM (out of month).</span>
<span class="c">* @method	isDateOOM</span>
<span class="c">* @param	{Date}	date	The JavaScript Date object for which to check the OOM status</span>
<span class="c">* @return	{Boolean}	true if the date is OOM</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">isDateOOM</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">date</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">return</span> <span class="o">(</span><span class="nx">date</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()</span> <span class="o">!=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">).</span><span class="nx">getMonth</span><span class="o">());</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c"> * Parses a pagedate configuration property value. The value can either be specified as a string of form &quot;mm/yyyy&quot; or a Date object </span>
<span class="c"> * and is parsed into a Date object normalized to the first day of the month. If no value is passed in, the month and year from today&#39;s date are used to create the Date object </span>
<span class="c"> * @method	_parsePageDate</span>
<span class="c"> * @private</span>
<span class="c"> * @param {Date|String}	date	Pagedate value which needs to be parsed</span>
<span class="c"> * @return {Date}	The Date object representing the pagedate</span>
<span class="c"> */</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">_parsePageDate</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">date</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">parsedDate</span><span class="o">;</span>
	
	<span class="k">var</span> <span class="nx">defCfg</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">;</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">date</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">if</span> <span class="o">(</span><span class="nx">date</span> <span class="k">instanceof</span> <span class="nb">Date</span><span class="o">)</span> <span class="o">{</span>
			<span class="nx">parsedDate</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">findMonthStart</span><span class="o">(</span><span class="nx">date</span><span class="o">);</span>
		<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
			<span class="k">var</span> <span class="nx">month</span><span class="o">,</span> <span class="nx">year</span><span class="o">,</span> <span class="nx">aMonthYear</span><span class="o">;</span>
			<span class="nx">aMonthYear</span> <span class="o">=</span> <span class="nx">date</span><span class="o">.</span><span class="nx">split</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">DATE_FIELD_DELIMITER</span><span class="o">.</span><span class="nx">key</span><span class="o">));</span>
			<span class="nx">month</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">aMonthYear</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MY_MONTH_POSITION</span><span class="o">.</span><span class="nx">key</span><span class="o">)-</span><span class="m">1</span><span class="o">],</span> <span class="m">10</span><span class="o">)-</span><span class="m">1</span><span class="o">;</span>
			<span class="nx">year</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">aMonthYear</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">defCfg</span><span class="o">.</span><span class="nx">MY_YEAR_POSITION</span><span class="o">.</span><span class="nx">key</span><span class="o">)-</span><span class="m">1</span><span class="o">],</span> <span class="m">10</span><span class="o">);</span>
			
			<span class="nx">parsedDate</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">year</span><span class="o">,</span> <span class="nx">month</span><span class="o">,</span> <span class="m">1</span><span class="o">);</span>
		<span class="o">}</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="nx">parsedDate</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">today</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">(),</span> <span class="k">this</span><span class="o">.</span><span class="nx">today</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">(),</span> <span class="m">1</span><span class="o">);</span>
	<span class="o">}</span>
	<span class="k">return</span> <span class="nx">parsedDate</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">// END UTILITY METHODS</span>
<span class="c"></span>
<span class="c">// BEGIN EVENT HANDLERS</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c">* Event executed before a date is selected in the calendar widget.</span>
<span class="c">* @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">onBeforeSelect</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">MULTI_SELECT</span><span class="o">.</span><span class="nx">key</span><span class="o">)</span> <span class="o">===</span> <span class="kc">false</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">)</span> <span class="o">{</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">callChildFunction</span><span class="o">(</span><span class="s2">&quot;clearAllBodyCellStyles&quot;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTED</span><span class="o">);</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">parent</span><span class="o">.</span><span class="nx">deselectAll</span><span class="o">();</span>
		<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">clearAllBodyCellStyles</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">Style</span><span class="o">.</span><span class="nx">CSS_CELL_SELECTED</span><span class="o">);</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">deselectAll</span><span class="o">();</span>
		<span class="o">}</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Event executed when a date is selected in the calendar widget.</span>
<span class="c">* @param	{Array}	selected	An array of date field arrays representing which date or dates were selected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]</span>
<span class="c">* @deprecated Event handlers for this event should be susbcribed to selectEvent.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">onSelect</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">selected</span><span class="o">)</span> <span class="o">{</span> <span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Event executed before a date is deselected in the calendar widget.</span>
<span class="c">* @deprecated Event handlers for this event should be susbcribed to beforeDeselectEvent.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">onBeforeDeselect</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> <span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Event executed when a date is deselected in the calendar widget.</span>
<span class="c">* @param	{Array}	selected	An array of date field arrays representing which date or dates were deselected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]</span>
<span class="c">* @deprecated Event handlers for this event should be susbcribed to deselectEvent.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">onDeselect</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">deselected</span><span class="o">)</span> <span class="o">{</span> <span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Event executed when the user navigates to a different calendar page.</span>
<span class="c">* @deprecated Event handlers for this event should be susbcribed to changePageEvent.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">onChangePage</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">render</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Event executed when the calendar widget is rendered.</span>
<span class="c">* @deprecated Event handlers for this event should be susbcribed to renderEvent.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">onRender</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> <span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Event executed when the calendar widget is reset to its original state.</span>
<span class="c">* @deprecated Event handlers for this event should be susbcribed to resetEvemt.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">onReset</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> <span class="k">this</span><span class="o">.</span><span class="nx">render</span><span class="o">();</span> <span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Event executed when the calendar widget is completely cleared to the current month with no selections.</span>
<span class="c">* @deprecated Event handlers for this event should be susbcribed to clearEvent.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">onClear</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> <span class="k">this</span><span class="o">.</span><span class="nx">render</span><span class="o">();</span> <span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Validates the calendar widget. This method has no default implementation</span>
<span class="c">* and must be extended by subclassing the widget.</span>
<span class="c">* @return	Should return true if the widget validates, and false if</span>
<span class="c">* it doesn&#39;t.</span>
<span class="c">* @type Boolean</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">validate</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span> <span class="k">return</span> <span class="kc">true</span><span class="o">;</span> <span class="o">};</span>

<span class="c">// END EVENT HANDLERS</span>
<span class="c"></span>
<span class="c">// BEGIN DATE PARSE METHODS</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c">* Converts a date string to a date field array</span>
<span class="c">* @private</span>
<span class="c">* @param	{String}	sDate			Date string. Valid formats are mm/dd and mm/dd/yyyy.</span>
<span class="c">* @return				A date field array representing the string passed to the method</span>
<span class="c">* @type Array[](Number[])</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">_parseDate</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">sDate</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">aDate</span> <span class="o">=</span> <span class="nx">sDate</span><span class="o">.</span><span class="nx">split</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">DATE_FIELD_DELIMITER</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">rArray</span><span class="o">;</span>

	<span class="k">if</span> <span class="o">(</span><span class="nx">aDate</span><span class="o">.</span><span class="nx">length</span> <span class="o">==</span> <span class="m">2</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">rArray</span> <span class="o">=</span> <span class="o">[</span><span class="nx">aDate</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">MD_MONTH_POSITION</span><span class="o">-</span><span class="m">1</span><span class="o">],</span><span class="nx">aDate</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">MD_DAY_POSITION</span><span class="o">-</span><span class="m">1</span><span class="o">]];</span>
		<span class="nx">rArray</span><span class="o">.</span><span class="nx">type</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">MONTH_DAY</span><span class="o">;</span>
	<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
		<span class="nx">rArray</span> <span class="o">=</span> <span class="o">[</span><span class="nx">aDate</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">MDY_YEAR_POSITION</span><span class="o">-</span><span class="m">1</span><span class="o">],</span><span class="nx">aDate</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">MDY_MONTH_POSITION</span><span class="o">-</span><span class="m">1</span><span class="o">],</span><span class="nx">aDate</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">MDY_DAY_POSITION</span><span class="o">-</span><span class="m">1</span><span class="o">]];</span>
		<span class="nx">rArray</span><span class="o">.</span><span class="nx">type</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">DATE</span><span class="o">;</span>
	<span class="o">}</span>

	<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">i</span><span class="o">&lt;</span><span class="nx">rArray</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span><span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
		<span class="nx">rArray</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">rArray</span><span class="o">[</span><span class="nx">i</span><span class="o">],</span> <span class="m">10</span><span class="o">);</span>
	<span class="o">}</span>

	<span class="k">return</span> <span class="nx">rArray</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Converts a multi or single-date string to an array of date field arrays</span>
<span class="c">* @private</span>
<span class="c">* @param	{String}	sDates		Date string with one or more comma-delimited dates. Valid formats are mm/dd, mm/dd/yyyy, mm/dd/yyyy-mm/dd/yyyy</span>
<span class="c">* @return							An array of date field arrays</span>
<span class="c">* @type Array[](Number[])</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">_parseDates</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">sDates</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">aReturn</span> <span class="o">=</span> <span class="o">[];</span>

	<span class="k">var</span> <span class="nx">aDates</span> <span class="o">=</span> <span class="nx">sDates</span><span class="o">.</span><span class="nx">split</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">DATE_DELIMITER</span><span class="o">);</span>
	
	<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">d</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">d</span><span class="o">&lt;</span><span class="nx">aDates</span><span class="o">.</span><span class="nx">length</span><span class="o">;++</span><span class="nx">d</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">var</span> <span class="nx">sDate</span> <span class="o">=</span> <span class="nx">aDates</span><span class="o">[</span><span class="nx">d</span><span class="o">];</span>

		<span class="k">if</span> <span class="o">(</span><span class="nx">sDate</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">DATE_RANGE_DELIMITER</span><span class="o">)</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span>
			<span class="c">// This is a range</span>
<span class="c"></span>			<span class="k">var</span> <span class="nx">aRange</span> <span class="o">=</span> <span class="nx">sDate</span><span class="o">.</span><span class="nx">split</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">Locale</span><span class="o">.</span><span class="nx">DATE_RANGE_DELIMITER</span><span class="o">);</span>

			<span class="k">var</span> <span class="nx">dateStart</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_parseDate</span><span class="o">(</span><span class="nx">aRange</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
			<span class="k">var</span> <span class="nx">dateEnd</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_parseDate</span><span class="o">(</span><span class="nx">aRange</span><span class="o">[</span><span class="m">1</span><span class="o">]);</span>

			<span class="k">var</span> <span class="nx">fullRange</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_parseRange</span><span class="o">(</span><span class="nx">dateStart</span><span class="o">,</span> <span class="nx">dateEnd</span><span class="o">);</span>
			<span class="nx">aReturn</span> <span class="o">=</span> <span class="nx">aReturn</span><span class="o">.</span><span class="nx">concat</span><span class="o">(</span><span class="nx">fullRange</span><span class="o">);</span>
		<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
			<span class="c">// This is not a range</span>
<span class="c"></span>			<span class="k">var</span> <span class="nx">aDate</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_parseDate</span><span class="o">(</span><span class="nx">sDate</span><span class="o">);</span>
			<span class="nx">aReturn</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">aDate</span><span class="o">);</span>
		<span class="o">}</span>
	<span class="o">}</span>
	<span class="k">return</span> <span class="nx">aReturn</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Converts a date range to the full list of included dates</span>
<span class="c">* @private</span>
<span class="c">* @param	{Number[]}	startDate	Date field array representing the first date in the range</span>
<span class="c">* @param	{Number[]}	endDate		Date field array representing the last date in the range</span>
<span class="c">* @return							An array of date field arrays</span>
<span class="c">* @type Array[](Number[])</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">_parseRange</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">startDate</span><span class="o">,</span> <span class="nx">endDate</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">dStart</span>   <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">startDate</span><span class="o">[</span><span class="m">0</span><span class="o">],</span><span class="nx">startDate</span><span class="o">[</span><span class="m">1</span><span class="o">]-</span><span class="m">1</span><span class="o">,</span><span class="nx">startDate</span><span class="o">[</span><span class="m">2</span><span class="o">]);</span>
	<span class="k">var</span> <span class="nx">dCurrent</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">add</span><span class="o">(</span><span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">startDate</span><span class="o">[</span><span class="m">0</span><span class="o">],</span><span class="nx">startDate</span><span class="o">[</span><span class="m">1</span><span class="o">]-</span><span class="m">1</span><span class="o">,</span><span class="nx">startDate</span><span class="o">[</span><span class="m">2</span><span class="o">]),</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">DAY</span><span class="o">,</span><span class="m">1</span><span class="o">);</span>
	<span class="k">var</span> <span class="nx">dEnd</span>     <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">endDate</span><span class="o">[</span><span class="m">0</span><span class="o">],</span>  <span class="nx">endDate</span><span class="o">[</span><span class="m">1</span><span class="o">]-</span><span class="m">1</span><span class="o">,</span>  <span class="nx">endDate</span><span class="o">[</span><span class="m">2</span><span class="o">]);</span>

	<span class="k">var</span> <span class="nx">results</span> <span class="o">=</span> <span class="o">[];</span>
	<span class="nx">results</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">startDate</span><span class="o">);</span>
	<span class="k">while</span> <span class="o">(</span><span class="nx">dCurrent</span><span class="o">.</span><span class="nx">getTime</span><span class="o">()</span> <span class="o">&lt;=</span> <span class="nx">dEnd</span><span class="o">.</span><span class="nx">getTime</span><span class="o">())</span> <span class="o">{</span>
		<span class="nx">results</span><span class="o">.</span><span class="nx">push</span><span class="o">([</span><span class="nx">dCurrent</span><span class="o">.</span><span class="nx">getFullYear</span><span class="o">(),</span><span class="nx">dCurrent</span><span class="o">.</span><span class="nx">getMonth</span><span class="o">()+</span><span class="m">1</span><span class="o">,</span><span class="nx">dCurrent</span><span class="o">.</span><span class="nx">getDate</span><span class="o">()]);</span>
		<span class="nx">dCurrent</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">add</span><span class="o">(</span><span class="nx">dCurrent</span><span class="o">,</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">DateMath</span><span class="o">.</span><span class="nx">DAY</span><span class="o">,</span><span class="m">1</span><span class="o">);</span>
	<span class="o">}</span>
	<span class="k">return</span> <span class="nx">results</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">// END DATE PARSE METHODS</span>
<span class="c"></span>
<span class="c">// BEGIN RENDERER METHODS</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c">* Resets the render stack of the current calendar to its original pre-render value.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">resetRenderers</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">renderStack</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_renderStack</span><span class="o">.</span><span class="nx">concat</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Clears the inner HTML, CSS class and style information from the specified cell.</span>
<span class="c">* @method clearElement</span>
<span class="c">* @param	{HTMLTableCellElement}	The cell to clear</span>
<span class="c">*/</span> 
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">clearElement</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">cell</span><span class="o">)</span> <span class="o">{</span>
	<span class="nx">cell</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&amp;#160;&quot;</span><span class="o">;</span>
	<span class="nx">cell</span><span class="o">.</span><span class="nx">className</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Adds a renderer to the render stack. The function reference passed to this method will be executed</span>
<span class="c">* when a date cell matches the conditions specified in the date string for this renderer.</span>
<span class="c">* @method addRenderer</span>
<span class="c">* @param	{String}	sDates		A date string to associate with the specified renderer. Valid formats</span>
<span class="c">*									include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)</span>
<span class="c">* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">addRenderer</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">sDates</span><span class="o">,</span> <span class="nx">fnRender</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">aDates</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_parseDates</span><span class="o">(</span><span class="nx">sDates</span><span class="o">);</span>
	<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">i</span><span class="o">&lt;</span><span class="nx">aDates</span><span class="o">.</span><span class="nx">length</span><span class="o">;++</span><span class="nx">i</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">var</span> <span class="nx">aDate</span> <span class="o">=</span> <span class="nx">aDates</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
	
		<span class="k">if</span> <span class="o">(</span><span class="nx">aDate</span><span class="o">.</span><span class="nx">length</span> <span class="o">==</span> <span class="m">2</span><span class="o">)</span> <span class="o">{</span> <span class="c">// this is either a range or a month/day combo</span>
<span class="c"></span>			<span class="k">if</span> <span class="o">(</span><span class="nx">aDate</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="k">instanceof</span> <span class="nb">Array</span><span class="o">)</span> <span class="o">{</span> <span class="c">// this is a range</span>
<span class="c"></span>				<span class="k">this</span><span class="o">.</span><span class="nx">_addRenderer</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">RANGE</span><span class="o">,</span><span class="nx">aDate</span><span class="o">,</span><span class="nx">fnRender</span><span class="o">);</span>
			<span class="o">}</span> <span class="k">else</span> <span class="o">{</span> <span class="c">// this is a month/day combo</span>
<span class="c"></span>				<span class="k">this</span><span class="o">.</span><span class="nx">_addRenderer</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">MONTH_DAY</span><span class="o">,</span><span class="nx">aDate</span><span class="o">,</span><span class="nx">fnRender</span><span class="o">);</span>
			<span class="o">}</span>
		<span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">aDate</span><span class="o">.</span><span class="nx">length</span> <span class="o">==</span> <span class="m">3</span><span class="o">)</span> <span class="o">{</span>
			<span class="k">this</span><span class="o">.</span><span class="nx">_addRenderer</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">DATE</span><span class="o">,</span><span class="nx">aDate</span><span class="o">,</span><span class="nx">fnRender</span><span class="o">);</span>
		<span class="o">}</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* The private method used for adding cell renderers to the local render stack.</span>
<span class="c">* This method is called by other methods that set the renderer type prior to the method call.</span>
<span class="c">* @method _addRenderer</span>
<span class="c">* @private</span>
<span class="c">* @param	{String}	type		The type string that indicates the type of date renderer being added.</span>
<span class="c">*									Values are YAHOO.widget.Calendar.DATE, YAHOO.widget.Calendar.MONTH_DAY, YAHOO.widget.Calendar.WEEKDAY,</span>
<span class="c">*									YAHOO.widget.Calendar.RANGE, YAHOO.widget.Calendar.MONTH</span>
<span class="c">* @param	{Array}		aDates		An array of dates used to construct the renderer. The format varies based</span>
<span class="c">*									on the renderer type</span>
<span class="c">* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">_addRenderer</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">type</span><span class="o">,</span> <span class="nx">aDates</span><span class="o">,</span> <span class="nx">fnRender</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">add</span> <span class="o">=</span> <span class="o">[</span><span class="nx">type</span><span class="o">,</span><span class="nx">aDates</span><span class="o">,</span><span class="nx">fnRender</span><span class="o">];</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">renderStack</span><span class="o">.</span><span class="nx">unshift</span><span class="o">(</span><span class="nx">add</span><span class="o">);</span>	
	<span class="k">this</span><span class="o">.</span><span class="nx">_renderStack</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">renderStack</span><span class="o">.</span><span class="nx">concat</span><span class="o">();</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Adds a month to the render stack. The function reference passed to this method will be executed</span>
<span class="c">* when a date cell matches the month passed to this method.</span>
<span class="c">* @method addMonthRenderer</span>
<span class="c">* @param	{Number}	month		The month (1-12) to associate with this renderer</span>
<span class="c">* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">addMonthRenderer</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">month</span><span class="o">,</span> <span class="nx">fnRender</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">_addRenderer</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">MONTH</span><span class="o">,[</span><span class="nx">month</span><span class="o">],</span><span class="nx">fnRender</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Adds a weekday to the render stack. The function reference passed to this method will be executed</span>
<span class="c">* when a date cell matches the weekday passed to this method.</span>
<span class="c">* @method addWeekdayRenderer</span>
<span class="c">* @param	{Number}	weekday		The weekday (0-6) to associate with this renderer</span>
<span class="c">* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">addWeekdayRenderer</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">weekday</span><span class="o">,</span> <span class="nx">fnRender</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">_addRenderer</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">WEEKDAY</span><span class="o">,[</span><span class="nx">weekday</span><span class="o">],</span><span class="nx">fnRender</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">// END RENDERER METHODS</span>
<span class="c"></span>
<span class="c">// BEGIN CSS METHODS</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c">* Removes all styles from all body cells in the current calendar table.</span>
<span class="c">* @method clearAllBodyCellStyles</span>
<span class="c">* @param	{style}		The CSS class name to remove from all calendar body cells</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">clearAllBodyCellStyles</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">style</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">c</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">c</span><span class="o">&lt;</span><span class="k">this</span><span class="o">.</span><span class="nx">cells</span><span class="o">.</span><span class="nx">length</span><span class="o">;++</span><span class="nx">c</span><span class="o">)</span> <span class="o">{</span>
		<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">cells</span><span class="o">[</span><span class="nx">c</span><span class="o">],</span><span class="nx">style</span><span class="o">);</span>
	<span class="o">}</span>
<span class="o">};</span>

<span class="c">// END CSS METHODS</span>
<span class="c"></span>
<span class="c">// BEGIN GETTER/SETTER METHODS</span>
<span class="c">/**</span>
<span class="c">* Sets the calendar&#39;s month explicitly</span>
<span class="c">* @method setMonth</span>
<span class="c">* @param {Number}	month		The numeric month, from 0 (January) to 11 (December)</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">setMonth</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">month</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">cfgPageDate</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">current</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">);</span>
	<span class="nx">current</span><span class="o">.</span><span class="nx">setMonth</span><span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">month</span><span class="o">,</span> <span class="m">10</span><span class="o">));</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">,</span> <span class="nx">current</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Sets the calendar&#39;s year explicitly.</span>
<span class="c">* @method setYear</span>
<span class="c">* @param {Number}	year		The numeric 4-digit year</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">setYear</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">year</span><span class="o">)</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">cfgPageDate</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">PAGEDATE</span><span class="o">.</span><span class="nx">key</span><span class="o">;</span>
	<span class="k">var</span> <span class="nx">current</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">);</span>
	<span class="nx">current</span><span class="o">.</span><span class="nx">setFullYear</span><span class="o">(</span><span class="nb">parseInt</span><span class="o">(</span><span class="nx">year</span><span class="o">,</span> <span class="m">10</span><span class="o">));</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="nx">cfgPageDate</span><span class="o">,</span> <span class="nx">current</span><span class="o">);</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Gets the list of currently selected dates from the calendar.</span>
<span class="c">* @method getSelectedDates</span>
<span class="c">* @return {Date[]} An array of currently selected JavaScript Date objects.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">getSelectedDates</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">var</span> <span class="nx">returnDates</span> <span class="o">=</span> <span class="o">[];</span>
	<span class="k">var</span> <span class="nx">selected</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">getProperty</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">_DEFAULT_CONFIG</span><span class="o">.</span><span class="nx">SELECTED</span><span class="o">.</span><span class="nx">key</span><span class="o">);</span>

	<span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">d</span><span class="o">=</span><span class="m">0</span><span class="o">;</span><span class="nx">d</span><span class="o">&lt;</span><span class="nx">selected</span><span class="o">.</span><span class="nx">length</span><span class="o">;++</span><span class="nx">d</span><span class="o">)</span> <span class="o">{</span>
		<span class="k">var</span> <span class="nx">dateArray</span> <span class="o">=</span> <span class="nx">selected</span><span class="o">[</span><span class="nx">d</span><span class="o">];</span>

		<span class="k">var</span> <span class="nx">date</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="o">(</span><span class="nx">dateArray</span><span class="o">[</span><span class="m">0</span><span class="o">],</span><span class="nx">dateArray</span><span class="o">[</span><span class="m">1</span><span class="o">]-</span><span class="m">1</span><span class="o">,</span><span class="nx">dateArray</span><span class="o">[</span><span class="m">2</span><span class="o">]);</span>
		<span class="nx">returnDates</span><span class="o">.</span><span class="nx">push</span><span class="o">(</span><span class="nx">date</span><span class="o">);</span>
	<span class="o">}</span>

	<span class="nx">returnDates</span><span class="o">.</span><span class="nx">sort</span><span class="o">(</span> <span class="k">function</span><span class="o">(</span><span class="nx">a</span><span class="o">,</span><span class="nx">b</span><span class="o">)</span> <span class="o">{</span> <span class="k">return</span> <span class="nx">a</span><span class="o">-</span><span class="nx">b</span><span class="o">;</span> <span class="o">}</span> <span class="o">);</span>
	<span class="k">return</span> <span class="nx">returnDates</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/// END GETTER/SETTER METHODS ///</span>
<span class="c"></span>
<span class="c">/**</span>
<span class="c">* Hides the Calendar&#39;s outer container from view.</span>
<span class="c">* @method hide</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">hide</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Shows the Calendar&#39;s outer container.</span>
<span class="c">* @method show</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">show</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">this</span><span class="o">.</span><span class="nx">oDomContainer</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;block&quot;</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* Returns a string representing the current browser.</span>
<span class="c">* @property browser</span>
<span class="c">* @type String</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">browser</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
			<span class="k">var</span> <span class="nx">ua</span> <span class="o">=</span> <span class="nx">navigator</span><span class="o">.</span><span class="nx">userAgent</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">();</span>
				  <span class="k">if</span> <span class="o">(</span><span class="nx">ua</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;opera&#39;</span><span class="o">)!=-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span> <span class="c">// Opera (check first in case of spoof)</span>
<span class="c"></span>					 <span class="k">return</span> <span class="s1">&#39;opera&#39;</span><span class="o">;</span>
				  <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">ua</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;msie 7&#39;</span><span class="o">)!=-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span> <span class="c">// IE7</span>
<span class="c"></span>					 <span class="k">return</span> <span class="s1">&#39;ie7&#39;</span><span class="o">;</span>
				  <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">ua</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;msie&#39;</span><span class="o">)</span> <span class="o">!=-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span> <span class="c">// IE</span>
<span class="c"></span>					 <span class="k">return</span> <span class="s1">&#39;ie&#39;</span><span class="o">;</span>
				  <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">ua</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;safari&#39;</span><span class="o">)!=-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span> <span class="c">// Safari (check before Gecko because it includes &quot;like Gecko&quot;)</span>
<span class="c"></span>					 <span class="k">return</span> <span class="s1">&#39;safari&#39;</span><span class="o">;</span>
				  <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">ua</span><span class="o">.</span><span class="nx">indexOf</span><span class="o">(</span><span class="s1">&#39;gecko&#39;</span><span class="o">)</span> <span class="o">!=</span> <span class="o">-</span><span class="m">1</span><span class="o">)</span> <span class="o">{</span> <span class="c">// Gecko</span>
<span class="c"></span>					 <span class="k">return</span> <span class="s1">&#39;gecko&#39;</span><span class="o">;</span>
				  <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
					 <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
				  <span class="o">}</span>
			<span class="o">}();</span>
<span class="c">/**</span>
<span class="c">* Returns a string representation of the object.</span>
<span class="c">* @method toString</span>
<span class="c">* @return {String}	A string representation of the Calendar object.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">.</span><span class="nx">prototype</span><span class="o">.</span><span class="nx">toString</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
	<span class="k">return</span> <span class="s2">&quot;Calendar &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">id</span><span class="o">;</span>
<span class="o">};</span>

<span class="c">/**</span>
<span class="c">* @namespace YAHOO.widget</span>
<span class="c">* @class Calendar_Core</span>
<span class="c">* @extends YAHOO.widget.Calendar</span>
<span class="c">* @deprecated The old Calendar_Core class is no longer necessary.</span>
<span class="c">*/</span>
<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar_Core</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">;</span>

<span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Cal_Core</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Calendar</span><span class="o">;</span>
</pre></div>
                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div class="module">
                        <h4>Modules</h4>
                        <ul class="content">

                                <li class=""><a href="module_animation.html">animation</a></li>

                                <li class=""><a href="module_autocomplete.html">autocomplete</a></li>

                                <li class=""><a href="module_button.html">button</a></li>

                                <li class="selected"><a href="module_calendar.html">calendar</a></li>

                                <li class=""><a href="module_connection.html">connection</a></li>

                                <li class=""><a href="module_container.html">container</a></li>

                                <li class=""><a href="module_datasource.html">datasource</a></li>

                                <li class=""><a href="module_datatable.html">datatable</a></li>

                                <li class=""><a href="module_dom.html">dom</a></li>

                                <li class=""><a href="module_dragdrop.html">dragdrop</a></li>

                                <li class=""><a href="module_element.html">element</a></li>

                                <li class=""><a href="module_event.html">event</a></li>

                                <li class=""><a href="module_history.html">history</a></li>

                                <li class=""><a href="module_logger.html">logger</a></li>

                                <li class=""><a href="module_menu.html">menu</a></li>

                                <li class=""><a href="module_slider.html">slider</a></li>

                                <li class=""><a href="module_tabview.html">tabview</a></li>

                                <li class=""><a href="module_treeview.html">treeview</a></li>

                                <li class=""><a href="module_yahoo.html">yahoo</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.widget.Calendar.html">YAHOO.widget.Calendar</a></li>
                                <li class=""><a href="YAHOO.widget.Calendar2up.html">YAHOO.widget.Calendar2up</a></li>
                                <li class=""><a href="YAHOO.widget.Calendar_Core.html">YAHOO.widget.Calendar_Core</a></li>
                                <li class=""><a href="YAHOO.widget.CalendarGroup.html">YAHOO.widget.CalendarGroup</a></li>
                                <li class=""><a href="YAHOO.widget.DateMath.html">YAHOO.widget.DateMath</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class="selected"><a href="Calendar.js.html">Calendar.js</a></li>
                                <li class=""><a href="CalendarGroup.js.html">CalendarGroup.js</a></li>
                                <li class=""><a href="DateMath.js.html">DateMath.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2007 Yahoo! Inc. All rights reserved.
	</div>
</div>
</body>
</html>
